Skip to content

Commit

Permalink
Tag image on quay on releases
Browse files Browse the repository at this point in the history
  • Loading branch information
poquirion committed Jan 15, 2024
1 parent 5d3f548 commit 65e389c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Tests suite
on:
release:
types:
- [released]

env:
REGISTRY_USER: c3genomics+github_pusher
IMAGE_REGISTRY: quay.io
REGISTRY_PASSWORD: ${{ secrets.QUAY_ROBOT_TOKEN }}
IMAGE: c3genomics/project_tracking
LATEST_RELEASE: latest_release

jobs:
build:
name: Release image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: pull release
run: |
# pull taged images and set to latest release
podman pull ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE }}:${{ env.RELEASE_VERSION }}
podman tag ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE }}:${{ env.RELEASE_VERSION }} \
${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE }}:${{ env.LATEST_RELEASE }}
- name: Push to repo
uses: redhat-actions/push-to-registry@v2
with:
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}
registry: ${{ env.IMAGE_REGISTRY }}
image: ${{ env.IMAGE }}
tags: ${{ env.LATEST_RELEASE }}
- name: Print image url
run: echo "Image pushed to ${{ steps.push-to-repo.outputs.registry-paths }}"

6 changes: 4 additions & 2 deletions .github/workflows/run_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE }}
tags: ${{ env.RELEASE_VERSION }} latest_release
tags: ${{ env.RELEASE_VERSION }}
containerfiles: ./Containerfile
- name: Push to repo
uses: redhat-actions/push-to-registry@v2
Expand All @@ -71,4 +71,6 @@ jobs:
password: ${{ env.REGISTRY_PASSWORD }}
registry: ${{ env.IMAGE_REGISTRY }}
image: ${{ env.IMAGE }}
tags: ${{ env.RELEASE_VERSION }} latest_release
tags: ${{ env.RELEASE_VERSION }}
- name: Print image url
run: echo "Image pushed to ${{ steps.push-to-repo.outputs.registry-paths }}"

0 comments on commit 65e389c

Please sign in to comment.