Skip to content

Commit

Permalink
Update docker push strategy (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrproliu authored Aug 7, 2024
1 parent c48d8db commit fa45e86
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/publish-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ on:
push:
branches:
- main
release:
types:
- released
tags:
- v*.*.*

jobs:
build-docker:
Expand Down Expand Up @@ -48,8 +47,18 @@ jobs:
images: |
ghcr.io/${{ github.repository }}
- name: Build and push Docker images
- 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: ${{ github.sha }}
labels: ${{ steps.meta.outputs.labels }}

- name: Build and push Docker images when release
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
if: startsWith(github.ref, 'refs/tags/v')
with:
context: .
push: true
Expand Down

0 comments on commit fa45e86

Please sign in to comment.