-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (35 loc) · 1.49 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Build and Push Docker Image
on:
push:
branches:
- master
- dev
workflow_dispatch:
env:
BOT_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/${{ github.repository }}/bot
SERVER_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/${{ github.repository }}/server
INITIALIZER_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/${{ github.repository }}/initializer
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Login to ghcr.io
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image for bot
run: docker build -t $BOT_IMAGE_NAME . -f Dockerfile-bot
- name: Build Docker image for server
run: docker build -t $SERVER_IMAGE_NAME . -f Dockerfile-server
- name: Build Docker image for initializer
run: docker build -t $INITIALIZER_IMAGE_NAME . -f Dockerfile-initializer
- name: Push Docker image for bot to ghcr.io
run: docker push $BOT_IMAGE_NAME
- name: Push Docker image for server to ghcr.io
run: docker push $SERVER_IMAGE_NAME
- name: Push Docker image for initializer to ghcr.io
run: docker push $INITIALIZER_IMAGE_NAME