add callout to leadership #49
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |