From cde0711e9453186022885e4196d4b486c7b3e586 Mon Sep 17 00:00:00 2001 From: "vault-token-factory-spectrocloud[bot]" <133815545+vault-token-factory-spectrocloud[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 22:05:22 -0700 Subject: [PATCH] ci: release branch PRs triggers (#1803) (#1812) (cherry picked from commit f223ef48415bf92c324cb383fae882d621fa2adf) Co-authored-by: Karl Cardenas --- .github/workflows/release-branch-pr.yaml | 65 ++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/release-branch-pr.yaml diff --git a/.github/workflows/release-branch-pr.yaml b/.github/workflows/release-branch-pr.yaml new file mode 100644 index 0000000000..ad2480ff18 --- /dev/null +++ b/.github/workflows/release-branch-pr.yaml @@ -0,0 +1,65 @@ +name: Release Branch PRs + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + branches: + - "release-[0-9]-[0-9]" + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + MENDABLE_API_KEY: ${{ secrets.MENDABLE_API_KEY }} + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + + +concurrency: + group: preview-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + + - name: Check out repository + uses: actions/checkout@v3 + + - name: Setup Node.js environment + uses: actions/setup-node@v3 + with: + node-version: "18" + cache: "npm" + + - run: npm ci + + + - name: Post Netlify progress + uses: mshick/add-pr-comment@v2 + with: + message: | + 🤖 Starting the Netlify preview build for commit ${{ github.sha }}. This may take a few minutes. + refresh-message-position: true + + + - name: Deploy to Netlify + id: netlify + uses: nwtgck/actions-netlify@v2.1.0 + with: + publish-dir: ./build + deploy-message: 'Manual Netlify deployment from GitHub Actions - ${{ github.sha }}' + enable-pull-request-comment: true + overwrites-pull-request-comment: true + enable-commit-comment: true + + - name: Post Netlify URL + uses: mshick/add-pr-comment@v2 + with: + message: | + 🚀 Netlify preview deployed succesfully for commit ${{ github.sha }}. Click [here](${{steps.netlify.outputs.deploy-url}}) to preview the changes. + message-failure: | + 👎 Uh oh! The Netlify Preview failed to deploy for commit ${{ github.sha }}. Please check the Netlify logs for more information. + refresh-message-position: true + update-only: true +