fix: Guardrail to avoid downtime #8019
Workflow file for this run
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: Docker | |
on: | |
push: | |
branches: | |
- master | |
- release-* | |
# Run tests for any PRs. | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: {} | |
jobs: | |
set-vars: | |
permissions: | |
contents: read | |
runs-on: ubuntu-latest | |
outputs: | |
controller-meta-tags: ${{ steps.controller-meta.outputs.tags }} | |
plugin-meta-tags: ${{ steps.plugin-meta.outputs.tags }} | |
platforms: ${{ steps.platform-matrix.outputs.platform-matrix }} | |
steps: | |
- name: Docker meta (controller) | |
id: controller-meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
quay.io/argoproj/argo-rollouts | |
tags: | | |
type=ref,event=branch,enable=${{ github.ref != 'refs/heads/master'}} | |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }} | |
- name: Docker meta (plugin) | |
id: plugin-meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
quay.io/argoproj/kubectl-argo-rollouts | |
tags: | | |
type=ref,event=branch,enable=${{ github.ref != 'refs/heads/master'}} | |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }} | |
# avoid building linux/arm64 for PRs since it takes so long | |
- name: Set Platform Matrix | |
id: platform-matrix | |
run: | | |
PLATFORM_MATRIX=linux/amd64 | |
if [[ "${{ github.event_name }}" == "push" || "${{ contains(github.event.pull_request.labels.*.name, 'test-arm-image') }}" == "true" ]] | |
then | |
PLATFORM_MATRIX=$PLATFORM_MATRIX,linux/arm64 | |
fi | |
echo "platform-matrix=$PLATFORM_MATRIX" >> $GITHUB_OUTPUT | |
build-and-push-controller-image: | |
needs: [set-vars] | |
permissions: | |
contents: read | |
packages: write # for pushing packages to GHCR, which is used by cd.apps.argoproj.io to avoid polluting Quay with tags | |
id-token: write # for creating OIDC tokens for signing. | |
uses: ./.github/workflows/image-reuse.yaml | |
with: | |
quay_image_name: ${{ needs.set-vars.outputs.controller-meta-tags }} | |
# Note: cannot use env variables to set go-version (https://docs.github.com/en/actions/using-workflows/reusing-workflows#limitations) | |
go-version: '1.22' | |
platforms: ${{ needs.set-vars.outputs.platforms }} | |
push: ${{ github.event_name != 'pull_request' }} | |
secrets: | |
quay_username: ${{ secrets.QUAY_USERNAME }} | |
quay_password: ${{ secrets.QUAY_ROBOT_TOKEN }} | |
build-and-push-plugin-image: | |
needs: [set-vars] | |
permissions: | |
contents: read | |
packages: write # for pushing packages to GHCR, which is used by cd.apps.argoproj.io to avoid polluting Quay with tags | |
id-token: write # for creating OIDC tokens for signing. | |
uses: ./.github/workflows/image-reuse.yaml | |
with: | |
quay_image_name: ${{ needs.set-vars.outputs.plugin-meta-tags }} | |
# Note: cannot use env variables to set go-version (https://docs.github.com/en/actions/using-workflows/reusing-workflows#limitations) | |
go-version: '1.22' | |
platforms: ${{ needs.set-vars.outputs.platforms }} | |
push: ${{ github.event_name != 'pull_request' }} | |
target: kubectl-argo-rollouts | |
secrets: | |
quay_username: ${{ secrets.QUAY_USERNAME }} | |
quay_password: ${{ secrets.QUAY_ROBOT_TOKEN }} |