chore: minor update/adjust #96
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Docker Image | |
concurrency: | |
group: docker-${{ github.event_name }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
push: | |
paths: | |
- '.github/workflows/**' | |
- 'challenge-service/**' | |
- 'player-service/**' | |
- 'game-service/**' | |
- 'geo-service/**' | |
- 'hrm-service/**' | |
branches: | |
- 'main' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
service: | |
- game | |
- hrm | |
- player | |
- geo | |
- challenge | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v2 | |
id: changes | |
with: | |
filters: | | |
src: | |
- '.github/workflows/docker.yml' | |
- '${{ matrix.service }}-service/**' | |
- name: Set up QEMU | |
if: steps.changes.outputs.src == 'true' | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: amd64 # we only need x86_64 arch for now. | |
- name: Set up Docker Buildx | |
if: steps.changes.outputs.src == 'true' | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
if: steps.changes.outputs.src == 'true' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and Push | |
if: steps.changes.outputs.src == 'true' | |
uses: docker/build-push-action@v3 | |
with: | |
context: ${{ matrix.service }}-service | |
platforms: linux/amd64 | |
push: true | |
tags: macrun/${{ matrix.service }}-service:latest |