Skip to content

Commit 9aba11c

Browse files
committed
Problem: container image is only local
This makes it harder to deploy it Solution: build it on GitHub as well
1 parent 6bde747 commit 9aba11c

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/image.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Container image
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }}
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
name: Build container image
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Log in to the Container registry
21+
uses: docker/login-action@v3
22+
with:
23+
registry: ${{ env.REGISTRY }}
24+
username: ${{ github.actor }}
25+
password: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Extract metadata (tags, labels) for Docker
28+
id: meta
29+
uses: docker/metadata-action@v5
30+
with:
31+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
32+
33+
- name: Build and push Docker image
34+
id: push
35+
uses: docker/build-push-action@v6
36+
with:
37+
platforms: linux/amd64,linux/arm64
38+
context: .
39+
push: true
40+
tags: ${{ steps.meta.outputs.tags }}
41+
labels: ${{ steps.meta.outputs.labels }}
42+
allow: security.insecure

0 commit comments

Comments
 (0)