1
+ name :Docker Build and Publish Fork
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ # Manual trigger only
6
+
7
+ env :
8
+ REGISTRY :ghcr.io
9
+ IMAGE_NAME :${{ github.repository }}
10
+
11
+ jobs :
12
+ build-and-push :
13
+ runs-on :ubuntu-latest
14
+ permissions :
15
+ contents :read
16
+ packages :write
17
+
18
+ steps :
19
+ -name :Checkout repository
20
+ uses :actions/checkout@v4
21
+
22
+ -name :Set up Docker Buildx
23
+ uses :docker/setup-buildx-action@v3
24
+
25
+ -name :Log into registry ${{ env.REGISTRY }}
26
+ uses :docker/login-action@v3
27
+ with :
28
+ registry :${{ env.REGISTRY }}
29
+ username :${{ github.actor }}
30
+ password :${{ secrets.GITHUB_TOKEN }}
31
+
32
+ -name :Extract Docker metadata
33
+ id :meta
34
+ uses :docker/metadata-action@v5
35
+ with :
36
+ images :${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
37
+ tags :|
38
+ type=sha
39
+ type=raw,value=latest
40
+
41
+ -name :Build and push Docker image
42
+ id :build-and-push
43
+ uses :docker/build-push-action@v5
44
+ with :
45
+ context :.
46
+ push :true
47
+ tags :${{ steps.meta.outputs.tags }}
48
+ labels :${{ steps.meta.outputs.labels }}
49
+ cache-from :type=gha
50
+ cache-to :type=gha,mode=max
51
+ platforms :linux/amd64
52
+ build-args :|
53
+ VERSION=${{ github.ref_name }}