-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docker image: retag workflow (#3679)
- Loading branch information
1 parent
a623509
commit 463469d
Showing
3 changed files
with
45 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Re-tag the given image and push it to the ghcr.io | ||
# Preserves the old tag. | ||
name: Docker Latest tag | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Tag of the base image to use' | ||
required: true | ||
type: string | ||
new_tag: | ||
description: 'New tag to use' | ||
default: 'latest' | ||
required: true | ||
type: string | ||
dry_run: | ||
description: "Don't push the tag to GHCR" | ||
required: true | ||
type: boolean | ||
default: false | ||
|
||
jobs: | ||
tag-docker-image: | ||
name: Retag image and push to GHCR | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Login to Github Packages | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Re-tag image | ||
run: | | ||
docker tag ghcr.io/chainsafe/forest:${{ github.event.inputs.tag }} ghcr.io/chainsafe/forest:${{ github.event.inputs.new_tag }} | ||
- name: Push image | ||
if: ${{ !github.event.inputs.dry_run }} | ||
run: | | ||
docker push ghcr.io/chainsafe/forest:${{ github.event.inputs.new_tag }} |
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
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