Skip to content

Commit

Permalink
fix wrong docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
mrproliu committed Aug 7, 2024
1 parent 5bf0b59 commit 4887678
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions .github/workflows/publish-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
name: publish-docker

on:
pull_request:
push:
branches:
- main
Expand All @@ -40,27 +41,25 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Determine tags for Docker image
id: set-tags
run: |
echo "TAGS=${{ github.sha }}" >> $GITHUB_ENV
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
echo "TAGS=type=ref,event=tag" >> $GITHUB_ENV
fi
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: |
ghcr.io/${{ github.repository }}
- name: Build and push Docker images when push to main
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
if: github.ref == 'refs/heads/main'
with:
context: .
push: true
tags: ${{ steps.meta.outputs.images }}:${{ github.sha }}
labels: ${{ steps.meta.outputs.labels }}
images: ghcr.io/${{ github.repository }}
tags: ${{ env.TAGS }}

- name: Build and push Docker images when release
- name: Build and push Docker images
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
if: startsWith(github.ref, 'refs/tags/v')
with:
context: .
push: true
tags: ${{ steps.meta.outputs.images }}:${{ steps.meta.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 4887678

Please sign in to comment.