Skip to content

GitHub release and NPM publishing #86

GitHub release and NPM publishing

GitHub release and NPM publishing #86

Workflow file for this run

name: GitHub release and NPM publishing
on:
workflow_run:
workflows: ["Build and test rules"]
branches:
- main
types:
- completed
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- uses: actions/setup-node@v3
with:
node-version: 22
cache: "yarn"
- id: install
name: Install dependencies
run: yarn install --frozen-lockfile
- id: compile
name: Compile the rules
run: yarn compile
- id: publish
name: NPM Publish
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
- name: Create Release
if: ${{ steps.publish.outputs.type }}
uses: softprops/action-gh-release@v2
with:
files: dist/*
tag_name: ${{ steps.publish.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build online documentation
if: ${{ steps.publish.outputs.type }}
run: |
yarn install --frozen-lockfile --cwd online-doc
yarn run doc:build
- name: Deploy to GitHub Pages
if: ${{ steps.publish.outputs.type }}
uses: crazy-max/ghaction-github-pages@v4
with:
target_branch: gh-pages
build_dir: online-doc/dist
jekyll: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}