Skip to content

Commit 58c4a6e

Browse files
committed
revive prerelease.yml workflow
1 parent 21d9efb commit 58c4a6e

File tree

2 files changed

+87
-44
lines changed

2 files changed

+87
-44
lines changed

.github/workflows/prerelease.yml

Lines changed: 85 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,96 @@
11
name: Build & Publish Raygun4JS to the pre-release environment
22

33
on:
4-
push:
5-
branches: [ master ]
64
workflow_dispatch:
7-
5+
86
jobs:
97
build:
108
runs-on: ubuntu-latest
119

1210
strategy:
1311
matrix:
14-
node-version: [12.x]
15-
12+
node-version: [ 20.x ]
13+
1614
steps:
17-
- uses: actions/checkout@v2
18-
19-
- name: Use Node.js ${{ matrix.node-version }}
20-
uses: actions/setup-node@v1
21-
with:
22-
node-version: ${{ matrix.node-version }}
23-
24-
- name: Install Grunt
25-
run: npm install -g grunt
26-
27-
- name: Install node modules
28-
run: npm install
29-
30-
- name: Build
31-
run: grunt build
32-
33-
- name: Complete
34-
run: echo Build successfully completed!
35-
36-
- name: Configure AWS Credentials
37-
uses: aws-actions/configure-aws-credentials@v1
38-
with:
39-
aws-access-key-id: ${{ secrets.AWS_ACCESS_ID }}
40-
aws-secret-access-key: ${{ secrets.AWS_ACCESS_SECRET }}
41-
aws-region: ${{ secrets.AWS_REGION }}
42-
43-
- name: Publish to S3 Pre-release
44-
run: aws s3 sync ./dist ${{ secrets.AWS_PUBLISH_TARGET }}
45-
46-
- name: Deployment Complete
47-
run: echo A new version of Raygun4JS has been deployed to pre-release!
48-
49-
- name: Notify Slack
50-
id: slack
51-
uses: slackapi/[email protected]
52-
env:
53-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
15+
- uses: actions/checkout@v4
16+
17+
- name: Use Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
22+
- name: Install Grunt
23+
run: npm install -g grunt
24+
25+
- name: Install node modules
26+
run: npm install
27+
28+
- name: Build
29+
id: build_step
30+
run: grunt build
31+
32+
- name: Configure AWS Credentials
33+
uses: aws-actions/configure-aws-credentials@v4
34+
with:
35+
aws-access-key-id: ${{ secrets.AWS_ACCESS_ID }}
36+
aws-secret-access-key: ${{ secrets.AWS_ACCESS_SECRET }}
37+
aws-region: ${{ secrets.AWS_REGION }}
38+
39+
- name: Publish to S3 Pre-release
40+
id: publish_s3
41+
run: aws s3 sync ./dist ${{ secrets.AWS_PUBLISH_TARGET }}
42+
43+
- name: Notify Slack
44+
id: slack
45+
uses: slackapi/[email protected]
46+
with:
47+
payload: |
48+
{
49+
"blocks": [
50+
{
51+
"type": "header",
52+
"text": {
53+
"type": "plain_text",
54+
"text": "A new pre-release version of Raygun4JS has been published"
55+
}
56+
},
57+
{
58+
"type": "section",
59+
"text": {
60+
"type": "plain_text",
61+
"text": "The Cloudfront cache will need to be invalidated for changes to take effect immediately."
62+
}
63+
},
64+
{
65+
"type": "section",
66+
"text": {
67+
"type": "mrkdwn",
68+
"text": "<https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|View this action run in GitHub>"
69+
}
70+
},
71+
{
72+
"type": "section",
73+
"fields": [
74+
{
75+
"type": "mrkdwn",
76+
"text": "*Branch:*\n`${{ github.ref_name }}`"
77+
},
78+
{
79+
"type": "mrkdwn",
80+
"text": "*Node version:*\n`${{ matrix.node-version }}`"
81+
},
82+
{
83+
"type": "mrkdwn",
84+
"text": "*Build status:*\n_${{ steps.build_step.outcome }}_"
85+
},
86+
{
87+
"type": "mrkdwn",
88+
"text": "*S3 sync status:*\n_${{ steps.publish_s3.outcome }}_"
89+
}
90+
]
91+
}
92+
]
93+
}
94+
env:
95+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
96+
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616

1717
- name: Use Node.js 20.x
18-
uses: actions/setup-node@v3
18+
uses: actions/setup-node@v4
1919
with:
2020
node-version: 20.x
2121

0 commit comments

Comments
 (0)