Skip to content

Latest

Latest #9

Workflow file for this run

# Latest updates the :latest tag for the quay.io/tinkerbell/hegel image to the latest release.
# The latest release is controlled by maintainers as defined by Github's 'latest release' flag
# on releases and can be generally defined as the latest major.minor.patch.
#
# Given this workflow is triggered when a release is published or edited, it is susceptible
# to being overtriggered. The workflow operates on the assumption that a published release has
# an associated docker image.
name: Latest
on:
workflow_dispatch: {}
release:
types: [published, edited]
env:
REGISTRY: quay.io
IMAGE: quay.io/${{ github.repository }}
jobs:
latest:
name: Update latest image tag
runs-on: ubuntu-latest
container:
image: alpine:latest
steps:
- name: Login to quay.io
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Install skopeo
run: |
apk update
apk add skopeo
- name: Tag and push
run: |
LATEST_RELEASE=$(curl -H "Accept: application/json" https://api.github.com/repos/tinkerbell/hegel/releases/latest | jq .name -r)
skopeo copy docker://${{ env.IMAGE }}:$LATEST_RELEASE docker://${{ env.IMAGE }}:latest