diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 916827c369..493add0059 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -44,7 +44,14 @@ jobs: name: Build Website (Self-Hosted Runner) runs-on: ["self-hosted", "linux", "x64", "vcenter3"] steps: + + - name: Force Failure + run: | + echo "CURRENT_STEP=Force Failure" >> $GITHUB_ENV + exit 1 + - name: Checkout Repository + run: echo "CURRENT_STEP=Checkout Repository" >> $GITHUB_ENV uses: actions/checkout@v4 with: fetch-depth: 0 @@ -52,27 +59,33 @@ jobs: - name: Setup Node.js environment + run: echo "CURRENT_STEP=Setup Node.js environment" >> $GITHUB_ENV uses: actions/setup-node@v4 with: node-version: "20" cache: "npm" - - run: npm ci - + - run: | + echo "CURRENT_STEP=npm ci" >> $GITHUB_ENV + npm ci + - name: Build run: | + echo "CURRENT_STEP=Build" >> $GITHUB_ENV touch .env make versions-ci make build-ci - name: Build with cached packs if: ${{ env.BUILD_EXIT_CODE == '5' }} + run: echo "CURRENT_STEP=Build with cached packs" >> $GITHUB_ENV uses: ./.github/actions/build-cached-packs with: gh-token: ${{ secrets.GITHUB_TOKEN }} - name: Upload to AWS run: | + echo "CURRENT_STEP=Upload to AWS" >> $GITHUB_ENV aws s3 sync --cache-control 'public, max-age=604800' --exclude '*.html' --exclude '*.xml' --exclude build/scripts/ build/ s3://docs.spectrocloud.com --delete aws s3 sync --cache-control 'public, max-age=0, s-maxage=604800' build/ s3://docs.spectrocloud.com --delete aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths "/*" @@ -87,7 +100,7 @@ jobs: SLACK_COLOR: "danger" SLACKIFY_MARKDOWN: true ENABLE_ESCAPES: true - SLACK_MESSAGE: "The self-hosted runner release job for `${{ github.workflow }}` in `${{ github.repository }}` failed. [View details](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})." + SLACK_MESSAGE: "The self-hosted runner release job for `${{ github.workflow }}` in `${{ github.repository }}` failed at step: `${{ env.CURRENT_STEP }}`. [View details](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})." # Use this workflow if you want to use the GitHub-hosted large runner. Useful for scenarios when you need a change to deploy faster than the self-hosted runner can build it. @@ -99,6 +112,7 @@ jobs: labels: docbot steps: - name: Checkout Repository + run: echo "CURRENT_STEP=Checkout Repository" >> $GITHUB_ENV uses: actions/checkout@v4 with: fetch-depth: 0 @@ -106,23 +120,29 @@ jobs: - name: Setup Node.js environment + run: echo "CURRENT_STEP=Setup Node.js environment" >> $GITHUB_ENV uses: actions/setup-node@v4 with: node-version: "20" cache: "npm" - - run: npm ci + - run: | + echo "CURRENT_STEP=npm ci" >> $GITHUB_ENV + npm ci - name: Versions run: | + echo "CURRENT_STEP=Versions" >> $GITHUB_ENV - name: Build run: | + echo "CURRENT_STEP=Build" >> $GITHUB_ENV touch .env make versions-ci make build-ci - name: Build with cached packs + run: echo "CURRENT_STEP=Build with cached packs" >> $GITHUB_ENV if: ${{ env.BUILD_EXIT_CODE == '5' }} uses: ./.github/actions/build-cached-packs with: @@ -130,6 +150,7 @@ jobs: - name: Upload to AWS run: | + echo "CURRENT_STEP=Upload to AWS" >> $GITHUB_ENV aws s3 sync --cache-control 'public, max-age=604800' --exclude '*.html' --exclude '*.xml' --exclude build/scripts/ build/ s3://docs.spectrocloud.com --delete aws s3 sync --cache-control 'public, max-age=0, s-maxage=604800' build/ s3://docs.spectrocloud.com --delete aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths "/*" @@ -144,7 +165,7 @@ jobs: SLACK_COLOR: "danger" SLACKIFY_MARKDOWN: true ENABLE_ESCAPES: true - SLACK_MESSAGE: "The large runner release job for `${{ github.workflow }}` in `${{ github.repository }}` failed. [View details](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})." + SLACK_MESSAGE: "The large runner release job for `${{ github.workflow }}` in `${{ github.repository }}` failed at step: `${{ env.CURRENT_STEP }}`. [View details](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})." release: name: "Release" @@ -154,12 +175,14 @@ jobs: steps: - id: checkout name: Checkout Repository + run: echo "CURRENT_STEP=Checkout Repository" >> $GITHUB_ENV uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} - name: Retrieve Credentials + run: echo "CURRENT_STEP=Retrieve Credentials" >> $GITHUB_ENV id: import-secrets uses: hashicorp/vault-action@v3.0.0 with: @@ -170,18 +193,23 @@ jobs: secrets: /providers/github/organizations/spectrocloud/token?org_name=spectrocloud token | VAULT_GITHUB_TOKEN - name: Setup Nodejs + run: echo "CURRENT_STEP=Setup Nodejs" >> $GITHUB_ENV uses: actions/setup-node@v4 with: node-version: "20" cache: "npm" - name: Install dependencies - run: npm ci + run: | + echo "CURRENT_STEP=Install dependencies" >> $GITHUB_ENV + npm ci - name: "release" env: GITHUB_TOKEN: ${{ steps.import-secrets.outputs.VAULT_GITHUB_TOKEN }} - run: npx semantic-release + run: | + echo "CURRENT_STEP=release" >> $GITHUB_ENV + npx semantic-release - name: Slack Notification on Failure if: ${{ failure() }} @@ -193,4 +221,4 @@ jobs: SLACK_COLOR: "danger" SLACKIFY_MARKDOWN: true ENABLE_ESCAPES: true - SLACK_MESSAGE: "The release job for `${{ github.workflow }}` in `${{ github.repository }}` failed. [View details](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})." \ No newline at end of file + SLACK_MESSAGE: "The release job for `${{ github.workflow }}` in `${{ github.repository }}` failed at step: `${{ env.CURRENT_STEP }}`. [View details](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})." \ No newline at end of file