-
Notifications
You must be signed in to change notification settings - Fork 11
43 lines (43 loc) · 1.5 KB
/
radar-release-actions.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
name: Publish package to npmjs
on:
release:
types: [ released ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v2
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: echo "MAJOR_VERSION=$(echo ${{ github.ref_name }} | cut -d '.' -f 1)" >> $GITHUB_ENV
- run: npm ci --force
- run: npm run build
- run: npm run test
- run: npm run check-latest-tag
- run: npm publish
- uses: jakejarvis/s3-sync-action@master
env:
AWS_S3_BUCKET: js.radar.com
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1'
SOURCE_DIR: 'cdn/'
DEST_DIR: ${{ github.ref_name }} # release tag
- uses: jakejarvis/s3-sync-action@master
env:
AWS_S3_BUCKET: js.radar.com
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1'
SOURCE_DIR: 'cdn/'
DEST_DIR: ${{ env.MAJOR_VERSION }} # release latest major version
- run: npm run compile-site
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site