Skip to content

Deploy

Deploy #10

Workflow file for this run

name: Deploy
on:
workflow_run:
workflows: ['CI']
branches: [main]
types:
- completed
jobs:
build:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: [ubuntu-latest]
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v2
- name: Set up node
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Set GitHub packages registry
run: |
npm config set '//npm.pkg.github.com/:_authToken' ${{ secrets.GH_TOKEN }}
npm config set @typeform:registry https://npm.pkg.github.com/
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Node.js dependencies
run: npm ci
- name: Deploy
if: contains(github.ref, 'refs/heads/main')
run: |
npm run build
npm run semantic-release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}