Skip to content

Commit

Permalink
Add workflow to add new git tags to images on quay.io (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfowl authored Oct 2, 2024
1 parent 1161eaa commit 2107270
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:

runs-on: ubuntu-latest

# https://github.com/redhat-actions/buildah-build#readme
steps:
- uses: actions/checkout@v4
# https://github.com/redhat-actions/buildah-build#readme
- name: Build container image
id: build-image
uses: redhat-actions/buildah-build@v2
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/tag-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Tag image on quay.io

env:
IMAGE_NAME: "rapidast"
IMAGE_REGISTRY: quay.io/redhatproductsecurity
IMAGE_REGISTRY_USER: ${{ secrets.IMAGE_REGISTRY_USER }}
IMAGE_REGISTRY_PASSWORD: ${{ secrets.IMAGE_REGISTRY_PASSWORD }}

on:
push:
tags: ["*"]

jobs:

tag-image:

runs-on: ubuntu-latest

steps:
# https://github.com/redhat-actions/podman-login
- name: Log in to quay.io
uses: redhat-actions/podman-login@v1
with:
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ env.IMAGE_REGISTRY_USER }}
password: ${{ env.IMAGE_REGISTRY_PASSWORD }}

- name: Tag image
run: |
# tag existing image on quay.io that has :<commit> tag with :<new> gh tag
SRC=${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
DST=${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
skopeo copy docker://${SRC} docker://${DST}

0 comments on commit 2107270

Please sign in to comment.