Skip to content

remove click from notes #55

remove click from notes

remove click from notes #55

name: build-and-deploy
on: [push,workflow_dispatch]
env:
BRANCH_NAME: ${{ github.ref_name }}
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: install slidevjs + playwright
run: 'npm i -g @slidev/cli && npm i -D playwright-chromium'
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- name: Cache node modules
uses: actions/cache@v4
id: cache
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: 'npm i'
- name: build slides
run: 'yes | slidev build'
- name: Get short commit SHA
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Deploy to Netlify
id: netlify_deploy
run: |
prod_flag=""
if [ "$BRANCH_NAME" = "main" ]; then prod_flag="--prod"; fi
netlify deploy \
--dir dist \
--message "CLI deploy via ${{ github.ref_name }}: commit ${{ steps.vars.outputs.sha_short }}, ${{ github.event.commits[0].message }}" \
--site ${{ secrets.NETLIFY_SITE_ID }} \
--auth ${{ secrets.NETLIFY_AUTH_TOKEN }} \
$prod_flag