tag as latest

This commit is contained in:
maddalax 2024-09-21 13:33:35 -05:00
parent a9d949b161
commit 48728af48a
2 changed files with 3 additions and 8 deletions

View file

@ -32,17 +32,11 @@ jobs:
- name: Build Docker image - name: Build Docker image
run: | run: |
cd ./htmgo-site && docker build -t ghcr.io/${{ github.repository_owner }}/htmgo-site:${{ steps.vars.outputs.short_sha }} . cd ./htmgo-site && docker build -t ghcr.io/${{ github.repository_owner }}/htmgo-site:${{ steps.vars.outputs.short_sha }} .
cd ./htmgo-site && docker tag ghcr.io/${{ github.repository_owner }}/htmgo-site:${{ steps.vars.outputs.short_sha }} ghcr.io/${{ github.repository_owner }}/htmgo-site:latest
- name: Log in to GitHub Container Registry - name: Log in to GitHub Container Registry
run: echo "${{ secrets.CR_PAT }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin run: echo "${{ secrets.CR_PAT }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push Docker image - name: Push Docker image
run: | run: |
docker push ghcr.io/${{ github.repository_owner }}/htmgo-site:${{ steps.vars.outputs.short_sha }} docker push ghcr.io/${{ github.repository_owner }}/htmgo-site:${{ steps.vars.outputs.short_sha }}
- name: Create Git tag
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git tag ${{ steps.vars.outputs.short_sha }}
git push origin ${{ steps.vars.outputs.short_sha }}

View file

@ -20,6 +20,7 @@ COPY . .
# Build the Go binary for Linux # Build the Go binary for Linux
RUN GOPRIVATE=github.com/maddalax LOG_LEVEL=debug go run github.com/maddalax/htmgo/cli/htmgo@latest build RUN GOPRIVATE=github.com/maddalax LOG_LEVEL=debug go run github.com/maddalax/htmgo/cli/htmgo@latest build
# Stage 2: Create the smallest possible image # Stage 2: Create the smallest possible image
FROM gcr.io/distroless/base-debian11 FROM gcr.io/distroless/base-debian11