Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Release Workflow

Release Workflow #66

Workflow file for this run

name: Release Workflow
on:
# Triggers the workflow after the Test Workflow has completed
workflow_run:
workflows: ['Test Workflow']
types:
- completed
branches:
- master
- next
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
BRANCH: ${{ github.event.workflow_run.head_branch }}
jobs:
release:
runs-on: ubuntu-latest
environment: release
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/setup-node@v3
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.BRANCH }}
- uses: actions/cache@v3
with:
path: ~/.npm
key: npm-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
npm-node-
- name: Install Deps
run: npm ci --ignore-scripts
- name: Build
run: npm run build
- name: Release to NPM
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: GITHUB_REF=${{ env.BRANCH }} npm run semantic-release