Skip to content

Merge pull request #38 from kstm-su/patch/fix-docker-iamge-1 #6

Merge pull request #38 from kstm-su/patch/fix-docker-iamge-1

Merge pull request #38 from kstm-su/patch/fix-docker-iamge-1 #6

Workflow file for this run

name: Build docker image
on:
workflow_dispatch:
push:
branches:
- main
jobs:
push:
name: "member-portal:${{ matrix.tag }}"
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
tag:
- backend
- frontend
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --debug
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name : Add short sha
run: echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | head -c7)" >> $GITHUB_ENV
- uses: docker/build-push-action@v6
with:
context: ./member-portal-${{ matrix.tag }}
file: ./member-portal-${{ matrix.tag }}/Dockerfile
platforms: linux/amd64
push: true
tags: |
ghcr.io/kstm-su/member-portal/${{ matrix.tag }}:latest
ghcr.io/kstm-su/member-portal/${{ matrix.tag }}:${{ env.GITHUB_SHA_SHORT }}
cache-from: type=gha,scope=member-portal-${{ matrix.tag }}
cache-to: type=gha,mode=max,scope=member-portal-${{ matrix.tag }}