Promote AWX Operator image #47
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Promote AWX Operator image | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
inputs: | |
tag_name: | |
description: 'Name for the tag of the release.' | |
required: true | |
jobs: | |
promote: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set TAG_NAME for workflow_dispatch event | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
run: | | |
echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV | |
- name: Set TAG_NAME for release event | |
if: ${{ github.event_name == 'release' }} | |
run: | | |
echo "TAG_NAME=${{ github.event.release.tag_name }}" >> $GITHUB_ENV | |
- uses: actions/checkout@v3 | |
with: | |
depth: 0 | |
- name: Log in to GHCR | |
run: | | |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Log in to Quay | |
run: | | |
echo ${{ secrets.QUAY_TOKEN }} | docker login quay.io -u ${{ secrets.QUAY_USER }} --password-stdin | |
- name: Re-tag and promote awx-operator image | |
run: | | |
docker pull ghcr.io/${{ github.repository }}:${TAG_NAME} | |
docker tag ghcr.io/${{ github.repository }}:${TAG_NAME} quay.io/${{ github.repository }}:${{ github.event.release.tag_name }} | |
docker tag ghcr.io/${{ github.repository }}:${TAG_NAME} quay.io/${{ github.repository }}:latest | |
docker push quay.io/${{ github.repository }}:${TAG_NAME} | |
docker push quay.io/${{ github.repository }}:latest | |
- name: Release Helm chart | |
run: | | |
ansible-playbook ansible/helm-release.yml -v \ | |
-e operator_image=quay.io/${{ github.repository }} \ | |
-e chart_owner=${{ github.repository_owner }} \ | |
-e tag=${TAG_NAME} \ | |
-e gh_token=${{ secrets.GITHUB_TOKEN }} \ | |
-e gh_user=${{ github.actor }} \ | |
-e repo_type=https |