Skip to content

Docker Latest tag

Docker Latest tag #17

# 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 pull ghcr.io/chainsafe/forest:${{ github.event.inputs.tag }}
docker tag ghcr.io/chainsafe/forest:${{ github.event.inputs.tag }} ghcr.io/chainsafe/forest:${{ github.event.inputs.new_tag }}
docker pull ghcr.io/chainsafe/forest:${{ github.event.inputs.tag }}-fat
docker tag ghcr.io/chainsafe/forest:${{ github.event.inputs.tag }}-fat ghcr.io/chainsafe/forest:${{ github.event.inputs.new_tag }}-fat
- name: Push image
if: ${{ !fromJSON(github.event.inputs.dry_run) }}
run: |
docker push ghcr.io/chainsafe/forest:${{ github.event.inputs.new_tag }}
docker push ghcr.io/chainsafe/forest:${{ github.event.inputs.new_tag }}-fat