Skip to content

Commit 21487a1

Browse files
authored
feat(ci): add to the build docker (#147)
* chore(workflows): consolidate CI and Docker build logic * fix: update Docker image repository to cremithq * fix(build): update version output destination * feat: separate ARM64 and AMD64 Docker builds * fix(workflow): update ARM os label to 'linux-arm64' in CI config
1 parent 2fdb7cc commit 21487a1

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Build and push Docker image
2+
3+
permissions:
4+
packages: write
5+
6+
on:
7+
push:
8+
# tags:
9+
# - "v*"
10+
# pull_request: # FOR TESTING PURPOSES
11+
12+
jobs:
13+
# ci:
14+
# uses: ./.github/workflows/ci-nebula.yaml
15+
16+
build:
17+
runs-on: ${{ matrix.os }}
18+
# needs: ci
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
app: [authority, authorization, backbone]
23+
os: [ubuntu-latest, linux-arm64]
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
# - name: Set release version
29+
# id: set_version
30+
# run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
31+
# shell: bash
32+
33+
- name: Set release version
34+
id: set_version
35+
run: echo "VERSION=alpha" >> $GITHUB_OUTPUT
36+
37+
- name: Set up QEMU
38+
uses: docker/setup-qemu-action@v3
39+
40+
- name: Set up Docker Buildx
41+
uses: docker/setup-buildx-action@v3
42+
43+
- name: Login to DockerHub
44+
uses: docker/login-action@v3
45+
with:
46+
registry: ghcr.io
47+
username: ${{ github.actor }}
48+
password: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Build and push (ARM64)
51+
uses: docker/build-push-action@v6
52+
if: ${{ matrix.os == 'linux-arm64' }}
53+
with:
54+
context: .
55+
file: ./crates/nebula-${{ matrix.app }}/Dockerfile
56+
platforms: linux/arm64/v8
57+
push: true
58+
tags: |
59+
ghcr.io/cremithq/nebula-${{ matrix.app }}:${{ steps.set_version.outputs.VERSION }}
60+
ghcr.io/cremithq/nebula-${{ matrix.app }}:latest
61+
cache-from: type=gha
62+
cache-to: type=gha,mode=max
63+
64+
- name: Build and push (AMD64)
65+
uses: docker/build-push-action@v6
66+
if: ${{ matrix.os == 'ubuntu-latest' }}
67+
with:
68+
context: .
69+
file: ./crates/nebula-${{ matrix.app }}/Dockerfile
70+
platforms: linux/amd64
71+
push: true
72+
tags: |
73+
ghcr.io/cremithq/nebula-${{ matrix.app }}:${{ steps.set_version.outputs.VERSION }}
74+
ghcr.io/cremithq/nebula-${{ matrix.app }}:latest
75+
cache-from: type=gha
76+
cache-to: type=gha,mode=max
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
push:
55
branches: [main]
66
pull_request:
7+
workflow_call:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
712

813
jobs:
914
test:

0 commit comments

Comments
 (0)