Promote Ascender Operator image #6
This file contains hidden or 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 Ascender 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 GitHub Env vars for workflow_dispatch event | |
| if: ${{ github.event_name == 'workflow_dispatch' }} | |
| run: | | |
| echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV | |
| - name: Set GitHub Env vars if release event | |
| if: ${{ github.event_name == 'release' }} | |
| run: | | |
| echo "TAG_NAME=${{ github.event.release.tag_name }}" >> $GITHUB_ENV | |
| - uses: actions/checkout@v4 | |
| with: | |
| depth: 0 | |
| - name: Log into registry ghcr.io | |
| uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Pull Tagged Staged Image and Publish to ghcr.io | |
| run: | | |
| docker buildx imagetools create \ | |
| ghcr.io/${{ github.repository }}:${{ env.TAG_NAME }} \ | |
| --tag ghcr.io/${{ github.repository }}:${{ env.TAG_NAME }} | |
| - name: Pull Staged Image and Publish to ghcr.io/${{ github.repository }}:latest | |
| run: | | |
| docker buildx imagetools create \ | |
| ghcr.io/${{ github.repository }}:${{ env.TAG_NAME }} \ | |
| --tag ghcr.io/${{ github.repository }}:latest |