Skip to content

Commit

Permalink
revive prerelease.yml workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
redJ4y committed Aug 20, 2024
1 parent 21d9efb commit 58c4a6e
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 44 deletions.
127 changes: 85 additions & 42 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,96 @@
name: Build & Publish Raygun4JS to the pre-release environment

on:
push:
branches: [ master ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]
node-version: [ 20.x ]

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install Grunt
run: npm install -g grunt

- name: Install node modules
run: npm install

- name: Build
run: grunt build

- name: Complete
run: echo Build successfully completed!

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_ID }}
aws-secret-access-key: ${{ secrets.AWS_ACCESS_SECRET }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Publish to S3 Pre-release
run: aws s3 sync ./dist ${{ secrets.AWS_PUBLISH_TARGET }}

- name: Deployment Complete
run: echo A new version of Raygun4JS has been deployed to pre-release!

- name: Notify Slack
id: slack
uses: slackapi/[email protected]
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install Grunt
run: npm install -g grunt

- name: Install node modules
run: npm install

- name: Build
id: build_step
run: grunt build

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_ID }}
aws-secret-access-key: ${{ secrets.AWS_ACCESS_SECRET }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Publish to S3 Pre-release
id: publish_s3
run: aws s3 sync ./dist ${{ secrets.AWS_PUBLISH_TARGET }}

- name: Notify Slack
id: slack
uses: slackapi/[email protected]
with:
payload: |
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "A new pre-release version of Raygun4JS has been published"
}
},
{
"type": "section",
"text": {
"type": "plain_text",
"text": "The Cloudfront cache will need to be invalidated for changes to take effect immediately."
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "<https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|View this action run in GitHub>"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Branch:*\n`${{ github.ref_name }}`"
},
{
"type": "mrkdwn",
"text": "*Node version:*\n`${{ matrix.node-version }}`"
},
{
"type": "mrkdwn",
"text": "*Build status:*\n_${{ steps.build_step.outcome }}_"
},
{
"type": "mrkdwn",
"text": "*S3 sync status:*\n_${{ steps.publish_s3.outcome }}_"
}
]
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js 20.x
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20.x

Expand Down

0 comments on commit 58c4a6e

Please sign in to comment.