Skip to content

Merge branch 'main' into beta #47

Merge branch 'main' into beta

Merge branch 'main' into beta #47

Workflow file for this run

name: build and deploy
on: [push]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read # to be able to publish a GitHub release
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
registry-url: "https://registry.npmjs.org"
- run: npm ci # install dependencies
- run: npm run build # build library
- run: npm run docs:build # build docs
- name: upload library artifacts
uses: actions/upload-artifact@v4
with:
name: library_dist
path: ./dist
- name: upload vitepress artifacts
uses: actions/upload-artifact@v4
with:
name: vitepress_dist
path: ./docs/.vitepress/dist
deploy-npm:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
registry-url: "https://registry.npmjs.org"
- run: npm ci # install dependencies
- name: Download build-results
uses: actions/download-artifact@v4
with:
name: library_dist
path: ./dist
- name: run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm run semantic-release
deploy-gh-pages:
runs-on: ubuntu-latest
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
contents: write
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
if: github.ref == 'refs/heads/main'
steps:
- name: Download build-results
uses: actions/download-artifact@v4
with:
name: vitepress_dist
path: ./docs/.vitepress/dist
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
id: deployment
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/.vitepress/dist