Skip to content

Commit f5bc2ba

Browse files
committed
feat: Docker buld and push
- Build docker image - Push it to ghcr.io
1 parent e672463 commit f5bc2ba

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

.github/workflows/build.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: "Build"
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
tags:
8+
- 'v*'
9+
10+
env:
11+
# Use docker.io for Docker Hub if empty
12+
REGISTRY: ghcr.io
13+
# GitHub repository as <account>/<repo>
14+
IMAGE_NAME: ${{ github.repository }}
15+
16+
jobs:
17+
docker:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Login to ${{ env.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: Set up QEMU
28+
uses: docker/setup-qemu-action@v3
29+
30+
- name: Set up Docker Buildx
31+
uses: docker/setup-buildx-action@v3
32+
33+
- name: Extract Docker metadata
34+
id: meta
35+
uses: docker/metadata-action@v5
36+
with:
37+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
38+
tags: |
39+
type=sha,format=long
40+
type=semver,pattern={{version}}
41+
type=semver,pattern={{major}}.{{minor}}
42+
flavor: |
43+
latest=false
44+
45+
- name: Build and push
46+
uses: docker/build-push-action@v6
47+
with:
48+
context: .
49+
push: true
50+
tags: ${{ steps.meta.outputs.tags }}
51+
labels: ${{ steps.meta.outputs.labels }}

compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ services:
1717
#]
1818
environment:
1919
- AUTHENTIK_TOKEN
20+
- API_KEY

0 commit comments

Comments
 (0)