Skip to content

feat: add build all docker images to GitHub workflow #11

feat: add build all docker images to GitHub workflow

feat: add build all docker images to GitHub workflow #11

Workflow file for this run

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