|
1 | 1 | name: Build & Publish Raygun4JS to the pre-release environment
|
2 | 2 |
|
3 | 3 | on:
|
4 |
| - push: |
5 |
| - branches: [ master ] |
6 | 4 | workflow_dispatch:
|
7 |
| - |
| 5 | + |
8 | 6 | jobs:
|
9 | 7 | build:
|
10 | 8 | runs-on: ubuntu-latest
|
11 | 9 |
|
12 | 10 | strategy:
|
13 | 11 | matrix:
|
14 |
| - node-version: [12.x] |
15 |
| - |
| 12 | + node-version: [ 20.x ] |
| 13 | + |
16 | 14 | 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 |
| - |
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 | + |
| 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 |
0 commit comments