-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run publish-workflow only on new releases rather than on every push
- Loading branch information
Showing
1 changed file
with
6 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,12 @@ | ||
name: Bump version and publish to ghcr.io | ||
name: Publish Docker image to ghcr.io | ||
on: | ||
push: | ||
branches: | ||
- master | ||
release: | ||
tags: | ||
- 'v*' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
tag: | ||
name: bump tags | ||
outputs: | ||
part: ${{ steps.bump_tag.outputs.part }} | ||
tag: ${{ steps.bump_tag.outputs.tag }} | ||
new_tag: ${{ steps.bump_tag.outputs.new_tag }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: '1' | ||
|
||
- name: Bump version and push tag | ||
id: bump_tag | ||
uses: anothrNick/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
WITH_V: true | ||
DEFAULT_BUMP: patch | ||
|
||
push_to_registry: | ||
needs: tag | ||
if: needs.tag.outputs.part != '' | ||
name: Push Docker image to Github Container registry | ||
runs-on: ubuntu-latest | ||
permissions: | ||
|
@@ -57,7 +36,7 @@ jobs: | |
file: ./Dockerfile | ||
push: true | ||
tags: | | ||
ghcr.io/${{ github.repository }}:${{ needs.tag.outputs.tag }} | ||
ghcr.io/${{ github.repository }}:${{ github.ref_name }} | ||
ghcr.io/${{ github.repository }}:latest | ||
labels: | | ||
org.opencontainers.image.source=${{ github.event.repository.clone_url }} | ||
|