Skip to content

chore: add actions cache #18

chore: add actions cache

chore: add actions cache #18

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@v1
with:
node-version: 20
cache: 'npm'
cache-dependency-path: package-lock.json
- run: npm add -D vitepress
- run: npm run docs:build
- name: deploy to netlify (prod)
if: ${{ github.ref_name == 'main' }}
uses: netlify/actions/cli@master
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
with:
args: deploy --dir=.vitepress/dist --prod
- name: deploy to netlify (dev)
if: ${{ github.ref_name != 'main' }}
uses: netlify/actions/cli@master
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
with:
args: deploy --dir=.vitepress/dist --alias=preview-${{ github.event.number }}