Skip to content

Commit 443acab

Browse files
authored
chore(build): add workflow for building images (#9)
1 parent ffb7e56 commit 443acab

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/docker.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Docker
2+
on:
3+
push:
4+
branches: [ "master" ]
5+
6+
jobs:
7+
build:
8+
name: "Build (${{ matrix.component }})"
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
packages: write
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
component: [frontend, backend]
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v3
20+
- name: Set up QEMU
21+
uses: docker/setup-qemu-action@v2
22+
with:
23+
platforms: arm64
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v2
26+
- name: Log into registry ${{ env.REGISTRY }}
27+
uses: docker/login-action@v2
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GH_TOKEN }}
32+
- name: Build and push Docker image
33+
uses: docker/build-push-action@v3
34+
with:
35+
context: ${{ matrix.component }}
36+
push: ${{ github.event_name != 'pull_request' }}
37+
platforms: linux/amd64
38+
file: ${{ matrix.component }}/Dockerfile
39+
tags: |
40+
ghcr.io/csesoc/subcomp-${{ matrix.component }}:${{ github.sha }}
41+
ghcr.io/csesoc/subcomp-${{ matrix.component }}:latest
42+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)