Skip to content

Commit 8611e21

Browse files
committed
Build Docker image with GitHub actions
1 parent 11ca2bb commit 8611e21

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Build and publish Docker image
2+
3+
on: [push]
4+
5+
env:
6+
REGISTRY: ghcr.io
7+
# make sure the name is lowercase, otherwise Docker won't accept it
8+
IMAGE_NAME: appimage/website
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
permissions:
15+
contents: read
16+
packages: write
17+
attestations: write
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Login to GitHub Container Registry
23+
uses: docker/login-action@v3
24+
with:
25+
registry: ${{ env.REGISTRY }}
26+
username: ${{ github.actor }}
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Extract metadata (tags, labels) for Docker
30+
id: meta
31+
uses: docker/metadata-action@v5
32+
with:
33+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
34+
35+
- name: Build and push Docker image
36+
uses: docker/build-push-action@v5
37+
with:
38+
context: .
39+
push: true
40+
tags: ${{ steps.meta.outputs.tags }}
41+
labels: ${{ steps.meta.outputs.labels }}
42+
platforms: |
43+
linux/amd64

0 commit comments

Comments
 (0)