Skip to content

Commit 8fa2218

Browse files
shyimjonasbn
authored andcommitted
feat: add arm64 image (rojopolis#218)
* feat: add arm64 image * ci: pin actions * ci: add sha
1 parent 3b93afd commit 8fa2218

File tree

1 file changed

+45
-8
lines changed

1 file changed

+45
-8
lines changed

.github/workflows/docker-build.yml

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,52 @@
11
name: Docker Image CI
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "*"
49

5-
jobs:
10+
permissions:
11+
contents: read
12+
packages: write
613

14+
jobs:
715
docker-build:
8-
916
runs-on: ubuntu-latest
10-
1117
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v4
14-
- name: Build the Docker image
15-
run: docker build . --file Dockerfile --tag spellcheck:$(date +%s)
18+
- name: Checkout
19+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
20+
21+
- name: Set up QEMU
22+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # ratchet:docker/setup-qemu-action@v3
23+
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # ratchet:docker/setup-buildx-action@v3
26+
27+
- name: Login to GitHub Registry
28+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # ratchet:docker/login-action@v3
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Metadata for the image
35+
id: meta
36+
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # ratchet:docker/metadata-action@v5
37+
with:
38+
images: ghcr.io/${{ github.repository }}
39+
tags: |
40+
type=sha
41+
type=ref,event=branch
42+
type=ref,event=pr
43+
type=semver,pattern={{version}}
44+
45+
- name: Build container
46+
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # ratchet:docker/build-push-action@v6
47+
with:
48+
platforms: "linux/amd64,linux/arm64"
49+
cache-from: type=gha
50+
cache-to: type=gha,mode=max
51+
push: true
52+
tags: ${{ steps.meta.outputs.tags }}

0 commit comments

Comments
 (0)