1+ name : Publish Docker Image to GHCR
12
2- name : Build and Push Test Image
3-
3+ # This workflow runs ONLY when you publish a new release.
44on :
5- push :
6- branches :
7- - keployAI
8- workflow_dispatch :
5+ release :
6+ types : [published]
97
108jobs :
11- build-and-push-test-image :
9+ build-and-publish :
10+ name : Build and Publish to GHCR
1211 runs-on : ubuntu-latest
1312 permissions :
1413 contents : read
15- packages : write
14+ packages : write # Required to push to GHCR
1615
1716 steps :
1817 - name : Checkout repository
@@ -26,17 +25,16 @@ jobs:
2625 with :
2726 registry : ghcr.io
2827 username : ${{ github.repository_owner }}
28+ # Use the standard GITHUB_TOKEN, which is automatically granted permissions
2929 password : ${{ secrets.GB_TOKEN }}
3030
31- # FIX: Use metadata-action to generate valid, lowercase tags automatically.
3231 - name : Extract metadata (tags, labels) for Docker
3332 id : meta
3433 uses : docker/metadata-action@v5
3534 with :
3635 # This will be automatically converted to lowercase: ghcr.io/euclidstellar/code-review-agent
3736 images : ghcr.io/${{ github.repository }}
38- # For this workflow, we only want to generate a single tag: 'test'
39- tags : type=raw,value=test
37+ # This automatically creates tags based on the release version, e.g., v1.0.0, v1, latest
4038
4139 - name : Build and push multi-platform image
4240 uses : docker/build-push-action@v5
4644 platforms : linux/amd64,linux/arm64
4745 # Use the valid tags generated by the metadata-action step
4846 tags : ${{ steps.meta.outputs.tags }}
49- labels : ${{ steps.meta.outputs.labels }}
47+ labels : ${{ steps.meta.outputs.labels }}
0 commit comments