Skip to content

Update docker-build.yml #9

Update docker-build.yml

Update docker-build.yml #9

Workflow file for this run

name: Build and Push Docker Images
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
service: [backend, worker, worker-cli]
include:
- service: backend
dockerfile: docker/docker/backend/Dockerfile
context: docker/docker/backend
- service: worker
dockerfile: docker/docker/worker/Dockerfile
context: docker/docker/worker
- service: worker-cli
dockerfile: docker/docker/worker-cli/Dockerfile
context: docker/docker/worker-cli
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up SSH agent
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Build and Push Docker Images
uses: docker/build-push-action@v2
with:
ssh: default
context: ${{ matrix.context }}
file: ${{ matrix.dockerfile }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.service }}:latest