-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (40 loc) · 1.25 KB
/
build.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
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 }}