Skip to content

Commit

Permalink
Merge pull request #261 from chrisdoherty4/chore/manual-latest-trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdoherty4 committed May 13, 2023
2 parents 500cdba + b5df07c commit f9a5d2f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ 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
Expand All @@ -27,9 +29,12 @@ jobs:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}

- name: Install skopeo
run: |
apk update
apk add skopeo
- name: Tag and push
run: |
LATEST=$(curl -H "Accept: application/json" https://api.github.com/repos/tinkerbell/hegel/releases/latest | jq .name -r)
docker pull ${{ env.IMAGE }}:$LATEST
docker tag ${{ env.IMAGE }}:$LATEST ${{ env.IMAGE }}:latest
docker push ${{ env.IMAGE }}:latest
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

0 comments on commit f9a5d2f

Please sign in to comment.