Skip to content

Commit

Permalink
Add tagging for latest release and latest docker image (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsoerensen authored Jan 13, 2024
1 parent 39ac255 commit d17dbf0
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions .github/workflows/docker-schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,40 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v4

- name: Get Current Release
id: get_current_release
uses: joutvhu/get-release@v1
with:
latest: true
pattern: '^.*'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get debug
run:
echo "Current release is ${{ steps.get_current_release.outputs.tag_name }}"

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Check out the repo
uses: actions/checkout@v4
with:
ref: ${{ steps.get_current_release.outputs.tag_name }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: |
images: |
ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
- name: Check out the repo
uses: actions/checkout@v4
with:
ref: ${{ steps.meta.outputs.tags }}
type=raw,value=${{ steps.get_current_release.outputs.tag_name }}
type=raw,value=latest
- name: Build and push Docker images
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
Expand All @@ -48,5 +62,5 @@ jobs:
BASE_ALGORAND_IMAGE=${{ steps.meta.outputs.tags }}
# Set push to false until ready to merge in
push: false
tags: ${{ steps.meta.outputs.tags }}, latest
tags: ${{ steps.get_current_release.outputs.tag_name }}, latest
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit d17dbf0

Please sign in to comment.