Skip to content

Commit 85bf25c

Browse files
committed
Simplify and restructure GitHub Actions workflow for ARM64 Docker image build, improving readability and consolidating steps.
1 parent 8230a2b commit 85bf25c

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,40 @@ name: Build and Push gh-runner (ARM64)
22

33
on:
44
push:
5-
branches: [ main ]
6-
tags: [ '*' ]
5+
branches:
6+
- main
7+
tags:
8+
- '*'
79
workflow_dispatch:
810

911
env:
12+
IMAGE_NAME: ghcr.io/spomky-labs/gh-runner
1013
RUNNER_VERSION: 2.327.1
1114

1215
jobs:
13-
build-arm64:
14-
runs-on: ubuntu-24.04-arm
16+
build:
17+
name: 🐳 Build Docker (ARM64)
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
packages: write
1522
steps:
16-
- name: Checkout
17-
uses: actions/checkout@v4
23+
- uses: actions/checkout@v4
1824

19-
- name: Lowercase owner
20-
id: vars
21-
run: echo "owner_lc=${GITHUB_REPOSITORY_OWNER,,}" >> "$GITHUB_OUTPUT"
22-
23-
- name: Log in to GHCR
25+
- name: Docker login to GHCR
2426
uses: docker/login-action@v3
2527
with:
2628
registry: ghcr.io
2729
username: ${{ github.actor }}
2830
password: ${{ secrets.GITHUB_TOKEN }}
2931

30-
- name: Build image (ARM64)
32+
- name: Build and push image
3133
run: |
32-
IMAGE_NAME=ghcr.io/${{ steps.vars.outputs.owner_lc }}/gh-runner
34+
IMAGE_TAG="${IMAGE_NAME}:latest"
35+
echo "Building ${IMAGE_TAG}"
3336
docker build \
3437
--build-arg RUNNER_VERSION=${RUNNER_VERSION} \
3538
--platform linux/arm64 \
36-
-t $IMAGE_NAME:latest .
37-
38-
- name: Push image
39-
run: |
40-
IMAGE_NAME=ghcr.io/${{ steps.vars.outputs.owner_lc }}/gh-runner
41-
docker push $IMAGE_NAME:latest
39+
-t ${IMAGE_TAG} \
40+
.
41+
docker push ${IMAGE_TAG}

0 commit comments

Comments
 (0)