Skip to content

v4.4.7

v4.4.7 #42

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