This repository has been archived by the owner on Nov 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade `actions/checkout` and `actions/setup-node` to target `v3`
- Loading branch information
1 parent
dc10eb9
commit 87805ed
Showing
6 changed files
with
72 additions
and
77 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ name: Cypress Nightly on Prod | |
|
||
on: | ||
schedule: | ||
- cron: '0 4 * * *' | ||
- cron: "0 4 * * *" | ||
|
||
jobs: | ||
cypress_nightly: | ||
|
@@ -18,12 +18,12 @@ jobs: | |
browser: [chrome] | ||
steps: | ||
- name: Setup Node | ||
uses: actions/setup-node@v2 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Cypress run | ||
uses: cypress-io/[email protected] | ||
|
@@ -51,4 +51,4 @@ jobs: | |
with: | ||
job-status: failure | ||
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} | ||
slack-channel: ${{ secrets.SLACK_CHANNEL }} | ||
slack-channel: ${{ secrets.SLACK_CHANNEL }} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,9 @@ name: PR Publish Docsite | |
on: | ||
pull_request: | ||
branches: | ||
- 'main' | ||
- "main" | ||
paths: | ||
- 'site/**' | ||
- "site/**" | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
|
@@ -28,12 +28,12 @@ jobs: | |
browser: [chrome] | ||
steps: | ||
- name: Setup Node | ||
uses: actions/setup-node@v2 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Cypress run | ||
uses: cypress-io/[email protected] | ||
|
@@ -64,10 +64,10 @@ jobs: | |
id: ${{steps.distribution.outputs.distribution-id}} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v2 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
|
@@ -87,15 +87,15 @@ jobs: | |
|
||
- name: Generate Static Site | ||
run: | | ||
cd site | ||
yarn install --pure-lockfile | ||
npm run build | ||
cd site | ||
yarn install --pure-lockfile | ||
npm run build | ||
- name: Sync Zip to Bucket | ||
run: | | ||
aws s3 sync ./site/build s3://staging-dev-docsite/$BRANCH_NAME --acl public-read | ||
aws s3 sync ./site/build s3://staging-dev-docsite/$BRANCH_NAME --acl public-read | ||
- name: Invalidate CF Cache | ||
- name: Invalidate CF Cache | ||
run: | | ||
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID}} --paths "/" "/*" | ||
|
@@ -111,15 +111,14 @@ jobs: | |
body: 'http://${{ env.BRANCH_NAME }}.staging-dev.bandwidth.com/' | ||
}) | ||
alert_if_failure: | ||
name: Alert for failure | ||
needs: [cypress, publish] | ||
if: failure() && !github.event.pull_request.draft | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get Branch Name | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ on: | |
types: | ||
- published | ||
workflow_dispatch: | ||
|
||
|
||
jobs: | ||
cypress: | ||
|
@@ -23,12 +22,12 @@ jobs: | |
browser: [chrome] | ||
steps: | ||
- name: Setup Node | ||
uses: actions/setup-node@v2 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Cypress run | ||
uses: cypress-io/[email protected] | ||
|
@@ -55,10 +54,10 @@ jobs: | |
if: ${{ !github.event.release.prerelease && github.event.release.target_commitish == 'main' }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v2 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
|
@@ -84,22 +83,19 @@ jobs: | |
- name: Invalidate Cloudfront Cache | ||
id: invalidate1 | ||
continue-on-error: true | ||
run: | ||
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID}} --paths "/" "/*" | ||
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID}} --paths "/" "/*" | ||
|
||
- name: Invalidate Cloudfront Cache Attempt 2 | ||
id: invalidate2 | ||
if: steps.invalidate1.outcome=='failure' | ||
continue-on-error: true | ||
run: | ||
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID}} --paths "/" "/*" | ||
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID}} --paths "/" "/*" | ||
|
||
- name: Invalidate Cloudfront Cache Attempt 3 | ||
continue-on-error: true | ||
id: invalidate3 | ||
if: steps.invalidate2.outcome=='failure' | ||
run: | ||
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID}} --paths "/" "/*" | ||
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID}} --paths "/" "/*" | ||
|
||
- name: Cloudfront Cache Invalidation Status | ||
if: always() | ||
|
@@ -108,7 +104,7 @@ jobs: | |
echo invalidation successful | ||
else | ||
exit 1 | ||
fi | ||
fi | ||
cypress_post_tests: | ||
name: Cypress run on prod | ||
|
@@ -129,7 +125,7 @@ jobs: | |
node-version: 16 | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Cypress Post Deployment Test | ||
uses: cypress-io/[email protected] | ||
|
@@ -146,7 +142,7 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COMMIT_INFO_MESSAGE: ${{github.event.pull_request.title}} | ||
COMMIT_INFO_SHA: ${{github.event.pull_request.head.sha}} | ||
|
||
notify_for_failures: | ||
name: Notify for Failures | ||
needs: [cypress_post_tests] | ||
|
@@ -158,27 +154,27 @@ jobs: | |
with: | ||
job-status: failure | ||
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} | ||
slack-channel: ${{ secrets.SLACK_CHANNEL }} | ||
slack-channel: ${{ secrets.SLACK_CHANNEL }} | ||
|
||
rollback_if_failed: | ||
needs: [cypress, publish, cypress_post_tests] | ||
name: Rollback Release | ||
if: ${{ failure() && github.event_name != 'workflow_dispatch' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
- name: Install Dependencies | ||
run: | | ||
cd ./.github/actions/rollback_release | ||
npm install | ||
- name: Rollback For Failed Cypress Tests | ||
id: rollback | ||
uses: ./.github/actions/rollback_release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }} | ||
- name: Rollback For Failed Cypress Tests | ||
id: rollback | ||
uses: ./.github/actions/rollback_release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }} |
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