From 8331ea9022a435421d16ed787a0901bb753686f3 Mon Sep 17 00:00:00 2001 From: Andrew Dryga Date: Tue, 24 Oct 2023 09:15:02 -0600 Subject: [PATCH] Move concurrency limit to the terraform step --- .github/workflows/cd.yml | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 85b15da35..4831135f3 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -8,11 +8,6 @@ env: # mark:automatic-version VERSION: "1.20231001.0" -# Cancel old workflow runs if new code is pushed -concurrency: - group: "cd-${{ github.workflow }}-${{ github.ref }}" - cancel-in-progress: false - jobs: ci: uses: ./.github/workflows/ci.yml @@ -23,6 +18,10 @@ jobs: # if: ${{ github.event.workflow_run.conclusion == 'success' }} permissions: contents: write + # Cancel old workflow runs if new code is pushed + concurrency: + group: "staging-deploy-${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: false needs: - ci env: @@ -160,7 +159,8 @@ jobs: tool: cross - name: Build release binaries env: - CARGO_OUTPUT_FILE: target/${{ matrix.arch.target }}/release/${{ matrix.name.package }} + CARGO_OUTPUT_FILE: + target/${{ matrix.arch.target }}/release/${{ matrix.name.package }} run: | dest="$BINARY_DEST_PATH-$VERSION" cross build --release -p ${{ matrix.name.package }} --target ${{ matrix.arch.target }} @@ -170,7 +170,10 @@ jobs: - name: Push binaries uses: softprops/action-gh-release@v1 with: - name: ${{ needs.update-release-draft.steps.update-release-draft.outputs.name }} + name: + ${{ + needs.update-release-draft.steps.update-release-draft.outputs.name + }} draft: true files: | rust/${{ env.BINARY_DEST_PATH }}* @@ -192,7 +195,9 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ steps.login.outputs.registry }}/firezone/${{ matrix.name.artifact }} + images: + ${{ steps.login.outputs.registry }}/firezone/${{ + matrix.name.artifact }} tags: | type=raw,value=${{ github.sha }} type=raw,value=${{ env.VERSION }} @@ -210,7 +215,10 @@ jobs: cache-to: | type=registry,ref=${{ steps.login.outputs.registry }}/firezone/cache/${{ matrix.name.artifact }}:main target: release - outputs: type=image,name=${{ steps.login.outputs.registry }}/firezone/${{ matrix.name.artifact }},push-by-digest=true,name-canonical=true,push=true + outputs: + type=image,name=${{ steps.login.outputs.registry }}/firezone/${{ + matrix.name.artifact + }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | mkdir -p /tmp/digests/${{ matrix.name.artifact }} @@ -253,7 +261,9 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ steps.login.outputs.registry }}/firezone/${{ matrix.image_name }} + images: + ${{ steps.login.outputs.registry }}/firezone/${{ matrix.image_name + }} tags: | type=raw,value=${{ github.sha }} type=raw,value=${{ env.VERSION }}