Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

Commit 87805ed

Browse files
authored
DX-3099 Update actions/checkout and actions/setup-node (#918)
Upgrade `actions/checkout` and `actions/setup-node` to target `v3`
1 parent dc10eb9 commit 87805ed

File tree

6 files changed

+72
-77
lines changed

6 files changed

+72
-77
lines changed

.github/workflows/cypress-prod-nightly.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Cypress Nightly on Prod
22

33
on:
44
schedule:
5-
- cron: '0 4 * * *'
5+
- cron: "0 4 * * *"
66

77
jobs:
88
cypress_nightly:
@@ -18,12 +18,12 @@ jobs:
1818
browser: [chrome]
1919
steps:
2020
- name: Setup Node
21-
uses: actions/setup-node@v2
21+
uses: actions/setup-node@v3
2222
with:
2323
node-version: 16
2424

2525
- name: Checkout
26-
uses: actions/checkout@v2
26+
uses: actions/checkout@v3
2727

2828
- name: Cypress run
2929
uses: cypress-io/[email protected]
@@ -51,4 +51,4 @@ jobs:
5151
with:
5252
job-status: failure
5353
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
54-
slack-channel: ${{ secrets.SLACK_CHANNEL }}
54+
slack-channel: ${{ secrets.SLACK_CHANNEL }}

.github/workflows/listener.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
if: ${{ github.event.action == 'Open' || github.event.action == 'Update' }}
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414

1515
- name: Pass branch name to env
1616
run: |
@@ -106,7 +106,7 @@ jobs:
106106
if: ${{ github.event.action == 'Close' }}
107107
runs-on: ubuntu-latest
108108
steps:
109-
- uses: actions/checkout@v2
109+
- uses: actions/checkout@v3
110110

111111
# Close the cooresponding PR
112112
# - run: |
@@ -136,7 +136,7 @@ jobs:
136136
if: ${{ github.event.action == 'Draft' }}
137137
runs-on: ubuntu-latest
138138
steps:
139-
- uses: actions/checkout@v2
139+
- uses: actions/checkout@v3
140140

141141
- name: Check and Update Draft Status
142142
run: |

.github/workflows/pr-closed-delete-staging-site.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ on:
66
pull_request:
77
types: [closed]
88
branches:
9-
- 'main'
9+
- "main"
1010
paths:
11-
- 'site/**'
11+
- "site/**"
1212

1313
jobs:
1414
cypress_cloudfront:
@@ -22,12 +22,12 @@ jobs:
2222
browser: [chrome]
2323
steps:
2424
- name: Setup Node
25-
uses: actions/setup-node@v2
25+
uses: actions/setup-node@v3
2626
with:
2727
node-version: 16
2828

2929
- name: Checkout
30-
uses: actions/checkout@v2
30+
uses: actions/checkout@v3
3131

3232
- name: Configure AWS Credentials
3333
uses: aws-actions/configure-aws-credentials@v1
@@ -41,7 +41,7 @@ jobs:
4141
BRANCH_NAME=${GITHUB_HEAD_REF#refs/heads/}
4242
BRANCH_NAME=$(echo "$BRANCH_NAME" | tr '[:upper:]' '[:lower:]')
4343
BRANCH_NAME=$(echo "$BRANCH_NAME" | sed -e "s/[^a-z0-9]/-/g")
44-
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
44+
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
4545
4646
- name: Create Cypress Config
4747
run: |
@@ -89,22 +89,22 @@ jobs:
8989
needs: [cypress_cloudfront]
9090
runs-on: ubuntu-latest
9191
steps:
92-
- name: Set Environment Variables
93-
run: |
94-
BRANCH_NAME=${GITHUB_HEAD_REF#refs/heads/}
95-
BRANCH_NAME=$(echo "$BRANCH_NAME" | tr '[:upper:]' '[:lower:]')
96-
BRANCH_NAME=$(echo "$BRANCH_NAME" | sed -e "s/[^a-z0-9]/-/g")
97-
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
92+
- name: Set Environment Variables
93+
run: |
94+
BRANCH_NAME=${GITHUB_HEAD_REF#refs/heads/}
95+
BRANCH_NAME=$(echo "$BRANCH_NAME" | tr '[:upper:]' '[:lower:]')
96+
BRANCH_NAME=$(echo "$BRANCH_NAME" | sed -e "s/[^a-z0-9]/-/g")
97+
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
9898
99-
- name: Configure AWS Credentials
100-
uses: aws-actions/configure-aws-credentials@v1
101-
with:
102-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
103-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
104-
aws-region: us-east-1
99+
- name: Configure AWS Credentials
100+
uses: aws-actions/configure-aws-credentials@v1
101+
with:
102+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
103+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
104+
aws-region: us-east-1
105105

106-
- name: Cleanup S3 Bucket
107-
run: aws s3 rm s3://staging-dev-docsite/ --recursive --exclude "*" --include "${{ env.BRANCH_NAME }}/*"
106+
- name: Cleanup S3 Bucket
107+
run: aws s3 rm s3://staging-dev-docsite/ --recursive --exclude "*" --include "${{ env.BRANCH_NAME }}/*"
108108

109109
notify_for_failures:
110110
name: Notify for Failures

.github/workflows/pr-publish-docsite.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ name: PR Publish Docsite
55
on:
66
pull_request:
77
branches:
8-
- 'main'
8+
- "main"
99
paths:
10-
- 'site/**'
10+
- "site/**"
1111
workflow_dispatch:
1212

1313
concurrency:
@@ -28,12 +28,12 @@ jobs:
2828
browser: [chrome]
2929
steps:
3030
- name: Setup Node
31-
uses: actions/setup-node@v2
31+
uses: actions/setup-node@v3
3232
with:
3333
node-version: 16
3434

3535
- name: Checkout
36-
uses: actions/checkout@v2
36+
uses: actions/checkout@v3
3737

3838
- name: Cypress run
3939
uses: cypress-io/[email protected]
@@ -64,10 +64,10 @@ jobs:
6464
id: ${{steps.distribution.outputs.distribution-id}}
6565
steps:
6666
- name: Checkout
67-
uses: actions/checkout@v2
67+
uses: actions/checkout@v3
6868

6969
- name: Setup Node
70-
uses: actions/setup-node@v2
70+
uses: actions/setup-node@v3
7171
with:
7272
node-version: 16
7373

@@ -87,15 +87,15 @@ jobs:
8787

8888
- name: Generate Static Site
8989
run: |
90-
cd site
91-
yarn install --pure-lockfile
92-
npm run build
90+
cd site
91+
yarn install --pure-lockfile
92+
npm run build
9393
9494
- name: Sync Zip to Bucket
9595
run: |
96-
aws s3 sync ./site/build s3://staging-dev-docsite/$BRANCH_NAME --acl public-read
96+
aws s3 sync ./site/build s3://staging-dev-docsite/$BRANCH_NAME --acl public-read
9797
98-
- name: Invalidate CF Cache
98+
- name: Invalidate CF Cache
9999
run: |
100100
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID}} --paths "/" "/*"
101101
@@ -111,15 +111,14 @@ jobs:
111111
body: 'http://${{ env.BRANCH_NAME }}.staging-dev.bandwidth.com/'
112112
})
113113
114-
115114
alert_if_failure:
116115
name: Alert for failure
117116
needs: [cypress, publish]
118117
if: failure() && !github.event.pull_request.draft
119118
runs-on: ubuntu-latest
120119
steps:
121120
- name: Checkout
122-
uses: actions/checkout@v2
121+
uses: actions/checkout@v3
123122

124123
- name: Get Branch Name
125124
run: |

.github/workflows/publish-docsite.yml

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
types:
88
- published
99
workflow_dispatch:
10-
1110

1211
jobs:
1312
cypress:
@@ -23,12 +22,12 @@ jobs:
2322
browser: [chrome]
2423
steps:
2524
- name: Setup Node
26-
uses: actions/setup-node@v2
25+
uses: actions/setup-node@v3
2726
with:
2827
node-version: 16
2928

3029
- name: Checkout
31-
uses: actions/checkout@v2
30+
uses: actions/checkout@v3
3231

3332
- name: Cypress run
3433
uses: cypress-io/[email protected]
@@ -55,10 +54,10 @@ jobs:
5554
if: ${{ !github.event.release.prerelease && github.event.release.target_commitish == 'main' }}
5655
steps:
5756
- name: Checkout
58-
uses: actions/checkout@v2
57+
uses: actions/checkout@v3
5958

6059
- name: Setup Node
61-
uses: actions/setup-node@v2
60+
uses: actions/setup-node@v3
6261
with:
6362
node-version: 16
6463

@@ -84,22 +83,19 @@ jobs:
8483
- name: Invalidate Cloudfront Cache
8584
id: invalidate1
8685
continue-on-error: true
87-
run:
88-
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID}} --paths "/" "/*"
86+
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID}} --paths "/" "/*"
8987

9088
- name: Invalidate Cloudfront Cache Attempt 2
9189
id: invalidate2
9290
if: steps.invalidate1.outcome=='failure'
9391
continue-on-error: true
94-
run:
95-
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID}} --paths "/" "/*"
92+
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID}} --paths "/" "/*"
9693

9794
- name: Invalidate Cloudfront Cache Attempt 3
9895
continue-on-error: true
9996
id: invalidate3
10097
if: steps.invalidate2.outcome=='failure'
101-
run:
102-
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID}} --paths "/" "/*"
98+
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID}} --paths "/" "/*"
10399

104100
- name: Cloudfront Cache Invalidation Status
105101
if: always()
@@ -108,7 +104,7 @@ jobs:
108104
echo invalidation successful
109105
else
110106
exit 1
111-
fi
107+
fi
112108
113109
cypress_post_tests:
114110
name: Cypress run on prod
@@ -129,7 +125,7 @@ jobs:
129125
node-version: 16
130126

131127
- name: Checkout
132-
uses: actions/checkout@v2
128+
uses: actions/checkout@v3
133129

134130
- name: Cypress Post Deployment Test
135131
uses: cypress-io/[email protected]
@@ -146,7 +142,7 @@ jobs:
146142
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
147143
COMMIT_INFO_MESSAGE: ${{github.event.pull_request.title}}
148144
COMMIT_INFO_SHA: ${{github.event.pull_request.head.sha}}
149-
145+
150146
notify_for_failures:
151147
name: Notify for Failures
152148
needs: [cypress_post_tests]
@@ -158,27 +154,27 @@ jobs:
158154
with:
159155
job-status: failure
160156
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
161-
slack-channel: ${{ secrets.SLACK_CHANNEL }}
157+
slack-channel: ${{ secrets.SLACK_CHANNEL }}
162158

163159
rollback_if_failed:
164160
needs: [cypress, publish, cypress_post_tests]
165161
name: Rollback Release
166162
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
167163
runs-on: ubuntu-latest
168164
steps:
169-
- uses: actions/checkout@v2
165+
- uses: actions/checkout@v3
170166

171-
- name: Setup Node
172-
uses: actions/setup-node@v2
173-
with:
174-
node-version: 16
167+
- name: Setup Node
168+
uses: actions/setup-node@v3
169+
with:
170+
node-version: 16
175171

176-
- name: Install Dependencies
177-
run: |
172+
- name: Install Dependencies
173+
run: |
178174
cd ./.github/actions/rollback_release
179175
npm install
180-
- name: Rollback For Failed Cypress Tests
181-
id: rollback
182-
uses: ./.github/actions/rollback_release
183-
env:
184-
GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}
176+
- name: Rollback For Failed Cypress Tests
177+
id: rollback
178+
uses: ./.github/actions/rollback_release
179+
env:
180+
GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}

.github/workflows/rollback-release.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ jobs:
1010
name: Rollback Release
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414

15-
- name: Setup Node
16-
uses: actions/setup-node@v2
17-
with:
18-
node-version: 16
15+
- name: Setup Node
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 16
1919

20-
- name: Install Dependencies
21-
run: |
20+
- name: Install Dependencies
21+
run: |
2222
cd ./.github/actions/rollback_release
2323
npm install
2424
25-
- name: Update the Bad Release to a Draft
26-
uses: ./.github/actions/rollback_release
27-
env:
28-
GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}
25+
- name: Update the Bad Release to a Draft
26+
uses: ./.github/actions/rollback_release
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}

0 commit comments

Comments
 (0)