Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub action to create Quay tags for release #3548

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/authorized-tag-creators.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
manaswinidas
andrewballantyne marked this conversation as resolved.
Show resolved Hide resolved
60 changes: 60 additions & 0 deletions .github/workflows/create-tag-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Create new Quay tag from latest main-tag for ODH release
on:
workflow_dispatch:
inputs:
existingTag:
description: Source tag
required: true
type: string
releaseTag:
description: Destination tag
required: true
type: string

env:
QUAY_ODH_DASHBOARD_IMAGE_REPO: ${{ secrets.QUAY_ODH_DASHBOARD_IMAGE_REPO }}

jobs:
create-tag:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Check authorized user
id: auth-check
run: |
AUTHORIZED_USERS_FILE=".github/workflows/authorized-tag-creators.txt"
if [[ ! -f "$AUTHORIZED_USERS_FILE" ]]; then
echo "Authorized users file not found!"
exit 1
fi
if ! grep -q "^${GITHUB_ACTOR}$" "$AUTHORIZED_USERS_FILE"; then
echo "User ${GITHUB_ACTOR} is not authorized to run this workflow."
exit 1
fi
- name: Install podman
shell: bash
run: |
sudo apt-get -y update
sudo apt-get -y install podman
- name: Pull Quay repository
shell: bash
run: |
podman pull ${QUAY_ODH_DASHBOARD_IMAGE_REPO}
- name: Create new release tag off of latest main-tag
shell: bash
run: |
podman tag odh-dashboard:${{ github.event.inputs.existingTag }} ${QUAY_ODH_DASHBOARD_IMAGE_REPO}:${{ github.event.inputs.releaseTag }}
- name: Login to quay.io
shell: bash
env:
QUAY_TOKEN: ${{ secrets.QUAY_ROBOT_TOKEN }}
QUAY_ROBOT_USERNAME: ${{ secrets.QUAY_ROBOT_USERNAME }}
run: |
podman login quay.io -u ${QUAY_ROBOT_USERNAME} -p ${QUAY_TOKEN}
- name: Push the latest release tag to Quay
shell: bash
run: |
podman push ${QUAY_ODH_DASHBOARD_IMAGE_REPO}:${{ github.event.inputs.releaseTag }}
Loading