From 01104631aaac0903372c512fd23745eeeb073ca4 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Fri, 12 Jan 2024 12:32:15 +1100 Subject: [PATCH] Remove legacy deployment actions This should be merged next week when we are sure that the new production environment is stable. --- ...eploy-polaris-staging.shopifycloud.com.yml | 78 ------------------- .../deploy-polaris.shopify.com-prod-kit.yml | 25 ------ .../workflows/deploy-polaris.shopify.com.yml | 8 +- 3 files changed, 2 insertions(+), 109 deletions(-) delete mode 100644 .github/workflows/deploy-polaris-staging.shopifycloud.com.yml delete mode 100644 .github/workflows/deploy-polaris.shopify.com-prod-kit.yml diff --git a/.github/workflows/deploy-polaris-staging.shopifycloud.com.yml b/.github/workflows/deploy-polaris-staging.shopifycloud.com.yml deleted file mode 100644 index 21f4efe8f8c..00000000000 --- a/.github/workflows/deploy-polaris-staging.shopifycloud.com.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: Trigger deploy of polaris-staging.shopifycloud.com - -on: - issue_comment: - types: - - created - -concurrency: ${{ github.workflow }}-${{ github.ref }} - -jobs: - trigger-deploy: - name: Deploy to staging - if: | - github.event.issue.pull_request && github.event.comment.body == '/stageit' - runs-on: ubuntu-latest - steps: - - name: Enforce permission requirement - uses: prince-chrismc/check-actor-permissions-action@v1 - with: - permission: write - - name: Validate pull request and get PR SHA - uses: actions/github-script@v6 - id: sha - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - result-encoding: string - script: | - try { - const pullRequest = await github.rest.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.issue.number, - }) - - // Pull request from fork - if (context.payload.repository.full_name !== pullRequest.data.head.repo.full_name) { - const errorMessage = '`/stageit` is not supported on pull requests from forked repositories.' - - await github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: errorMessage, - }) - - core.setFailed(errorMessage) - } else { - return pullRequest.data.head.sha - } - } catch (err) { - core.setFailed(`Request failed with error ${err}`) - } - - name: Trigger deploy polaris-staging.shopifycloud.com - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} - script: | - await github.rest.actions.createWorkflowDispatch({ - owner: "shopify", - repo: "polaris-site-container-builder", - workflow_id: "trigger-deploy.yml", - ref: "staging-bdvt", - inputs: { - sha: "${{steps.sha.outputs.result}}", - target: 'staging', - } - }); - - name: Create comment - uses: actions/github-script@v6 - with: - script: | - github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: `\`🚀 ${{steps.sha.outputs.result}}\` is now deploying to staging. [View status](https://shipit.shopify.io/shopify/polaris-site-container-builder/staging-bdvt/tasks).`, - }); diff --git a/.github/workflows/deploy-polaris.shopify.com-prod-kit.yml b/.github/workflows/deploy-polaris.shopify.com-prod-kit.yml deleted file mode 100644 index fc6531b879b..00000000000 --- a/.github/workflows/deploy-polaris.shopify.com-prod-kit.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Trigger deploy of polaris.shopify.com - -on: - push: - branches: - - main - paths: - - 'polaris.shopify.com/**' - -jobs: - trigger-deploy: - runs-on: ubuntu-latest - - steps: - - name: Trigger deploy polaris.shopify.com - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }} - script: | - await github.rest.actions.createWorkflowDispatch({ - owner: "shopify", - repo: "polaris-site-prod-kit", - workflow_id: "build-and-deploy.yml", - ref: "main", - }); diff --git a/.github/workflows/deploy-polaris.shopify.com.yml b/.github/workflows/deploy-polaris.shopify.com.yml index db0b0bc0a2b..fc6531b879b 100644 --- a/.github/workflows/deploy-polaris.shopify.com.yml +++ b/.github/workflows/deploy-polaris.shopify.com.yml @@ -19,11 +19,7 @@ jobs: script: | await github.rest.actions.createWorkflowDispatch({ owner: "shopify", - repo: "polaris-site-container-builder", - workflow_id: "trigger-deploy.yml", + repo: "polaris-site-prod-kit", + workflow_id: "build-and-deploy.yml", ref: "main", - inputs: { - sha: context.sha, - target: 'production' - } });