Skip to content

fix: set github-token #28

fix: set github-token

fix: set github-token #28

Workflow file for this run

name: Deploy
on:
pull_request:
paths-ignore:
- 'README.md'
push:
branches:
- main
paths-ignore:
- 'README.md'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: package-lock.json
- run: npm add -D vitepress
- run: npm run docs:build
- run: npm install netlify-cli -g
- name: deploy to netlify (prod)
if: ${{ github.ref_name == 'main' }}
run: |
netlify deploy \
--dir .vitepress/dist \
--site ${{ secrets.NETLIFY_SITE_ID }} \
--auth ${{ secrets.NETLIFY_AUTH_TOKEN }} \
--prod
- name: deploy to netlify (dev)
if: ${{ github.ref_name != 'main' }}
run: |
netlify deploy \
--dir .vitepress/dist \
--site ${{ secrets.NETLIFY_SITE_ID }} \
--auth ${{ secrets.NETLIFY_AUTH_TOKEN }} \
--alias preview-${{ github.event.number }}