@@ -57,40 +57,41 @@ jobs:
5757 echo "tag=${TAG}" >> $GITHUB_OUTPUT
5858 echo "Image will be tagged as: ${TAG}"
5959
60- # Step 3: Log into GitHub Container Registry
60+ # Step 3: Lowercase the repository owner
61+ - name : Set lowercase owner
62+ id : owner
63+ run : echo "value=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
64+
65+ # Step 4: Log into GitHub Container Registry
6166 - name : Login to GitHub Container Registry
6267 uses : docker/login-action@v3
6368 with :
6469 registry : ghcr.io
6570 username : ${{ github.actor }}
6671 password : ${{ secrets.GITHUB_TOKEN }}
6772
68- # Step 4 : Set up Docker Buildx
73+ # Step 5 : Set up Docker Buildx
6974 - name : Set up Docker Buildx
7075 uses : docker/setup-buildx-action@v3
7176
72- # Step 5: Build the frontend image and push to GHCR
73- # The nginx Dockerfile does two things:
74- # - builds the React app (using node:22-slim as builder)
75- # - copies the built files into nginx:alpine to serve them
76- # So the build context must be ./vault (parent of both frontend/ and nginx/)
77- # because the Dockerfile references both directories
77+ # Step 6: Build the frontend image and push to GHCR
78+ # context must be ./vault (parent of both frontend/ and nginx/)
79+ # because the Dockerfile copies from both directories
7880 - name : Build and push
7981 uses : docker/build-push-action@v5
8082 with :
8183 context : ./vault
8284 file : ./vault/nginx/Dockerfile
8385 push : true
8486 tags : |
85- ghcr.io/${{ github.repository_owner }}/vault-nginx:${{ steps.tag.outputs.tag }}
86- ghcr.io/${{ github.repository_owner }}/vault-nginx:latest
87- # Cache layers from the previous build to speed up future builds
87+ ghcr.io/${{ steps.owner.outputs.value }}/vault-nginx:${{ steps.tag.outputs.tag }}
88+ ghcr.io/${{ steps.owner.outputs.value }}/vault-nginx:latest
8889 cache-from : type=gha
8990 cache-to : type=gha,mode=max
9091
91- # Step 6 : Print a summary
92+ # Step 7 : Print a summary
9293 - name : Print image details
9394 run : |
9495 echo "✅ Image pushed successfully"
95- echo "📦 ghcr.io/${{ github.repository_owner }}/vault-nginx:${{ steps.tag.outputs.tag }}"
96- echo "📦 ghcr.io/${{ github.repository_owner }}/vault-nginx:latest"
96+ echo "📦 ghcr.io/${{ steps.owner.outputs.value }}/vault-nginx:${{ steps.tag.outputs.tag }}"
97+ echo "📦 ghcr.io/${{ steps.owner.outputs.value }}/vault-nginx:latest"
0 commit comments