Skip to content

refactor(components): simplify event handlers and clean unused code #21

refactor(components): simplify event handlers and clean unused code

refactor(components): simplify event handlers and clean unused code #21

Workflow file for this run

# https://github.com/actions/deploy-pages#usage
name: Deploy docs to GitHub Pages
on:
workflow_dispatch:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9.15.4
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('docs/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Cache node_modules
uses: actions/cache@v4
with:
path: |
docs/node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('docs/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-modules-
- name: Install dependencies
run: pnpm install
- name: Build docs
run: NUXT_APP_BASE_URL=/switchshuttle/ pnpm nuxt build --preset github_pages
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.output/public
# Deployment job
deploy:
# Add a dependency to the build job
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github_pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4