diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index 1b57dff..f1974b0 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -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 diff --git a/.github/workflows/tag-image.yml b/.github/workflows/tag-image.yml new file mode 100644 index 0000000..ea6b1b1 --- /dev/null +++ b/.github/workflows/tag-image.yml @@ -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 : tag with : 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}