Skip to content

Commit 955a8dc

Browse files
committed
feat: add GitHub Actions workflow for building and pushing Docker images
1 parent dadc6db commit 955a8dc

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/docker-build.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build & Push Docker image
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
permissions:
9+
contents: read
10+
packages: write
11+
12+
concurrency:
13+
group: docker-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
docker-build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout source
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Set up QEMU
26+
uses: docker/setup-qemu-action@v3
27+
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v3
30+
31+
- name: Log in to GHCR
32+
uses: docker/login-action@v3
33+
with:
34+
registry: ghcr.io
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Build and push Docker image
39+
uses: docker/build-push-action@v5
40+
with:
41+
context: .
42+
push: true
43+
platforms: linux/amd64,linux/arm64
44+
tags: |
45+
ghcr.io/${{ github.repository_owner }}/plexaubnet:${{ github.ref_name }}
46+
ghcr.io/${{ github.repository_owner }}/plexaubnet:latest
47+
labels: |
48+
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
49+
org.opencontainers.image.revision=${{ github.sha }}
50+
org.opencontainers.image.version=${{ github.ref_name }}
51+
org.opencontainers.image.created=${{ github.event.repository.updated_at }}
52+
cache-from: type=gha
53+
cache-to: type=gha,mode=max
54+
provenance: false
55+
sbom: false

0 commit comments

Comments
 (0)