This repository has been archived by the owner on Jul 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
48 lines (48 loc) · 2.27 KB
/
Release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Release a new version of Pebble
on:
push:
tags: 'v*'
jobs:
deploy:
name: deploy documentation site
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: install dependencies
run: npm install
- name: build documentation site
run: npm run styleguide:build
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET }}
aws-region: us-west-2
- name: deploy js files
run: aws s3 cp --recursive styleguide s3://${{ secrets.AWS_BUCKET_NAME }} --cache-control max-age=2592000 --exclude service-worker.js --exclude index.html
- name: deploy service-worker.js
run: aws s3 cp styleguide/service-worker.js s3://${{ secrets.AWS_BUCKET_NAME }}/service-worker.js --metadata-directive REPLACE --cache-control max-age=0,must-revalidate --content-type application/javascript
- name: deploy index.html
run: aws s3 cp styleguide/index.html s3://${{ secrets.AWS_BUCKET_NAME }}/index.html --metadata-directive REPLACE --cache-control max-age=0,must-revalidate --content-type text/html
- name: Publish to NPM
run: |
npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
npm publish --tag next
- name: Calculate version
id: get_version
run: |
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
echo ::set-output name=VERSION_WITHOUT_V::${GITHUB_REF/refs\/tags\/v/}
- name: Notify Slack
uses: pullreminders/slack-action@master
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
args: '{\"channel\":\"CQ9AG10AC\",\"text\":\":shipit: ${{ steps.get_version.outputs.VERSION }} of Pebble has been released!\n<https://pebble.istreamplanet.net/|Documentation> | <https://www.npmjs.com/package/@istreamplanet/pebble/v/${{ steps.get_version.outputs.VERSION_WITHOUT_V }}|NPM>\"}'