Migrate to vite #1018
Workflow file for this run
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: Docs | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build Docs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly. | |
with: | |
persist-credentials: false | |
- name: Setup Node.js | |
uses: actions/[email protected] | |
with: | |
node-version: 20.x | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Prepare pnpm using Corepack | |
run: corepack prepare pnpm | |
- name: Install node packages 📦 | |
run: | | |
pnpm install --frozen-lockfile | |
env: | |
CI: true | |
- name: Build docs 🔧 | |
working-directory: docs/ | |
run: | | |
pnpm build | |
- name: Upload build artifact 📤 | |
if: github.event_name != 'pull_request' # We only need the build if we deploy it later. | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-folder | |
path: docs/build/ | |
retention-days: 1 # Keep the artifact for the minimal amount of time possible. | |
deploy: | |
name: Deploy Docs | |
needs: build | |
if: success() && github.event_name != 'pull_request' # Only deploy the build if it is a push to the main branch and the build was successful. | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/[email protected] # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly. | |
with: | |
persist-credentials: false | |
- name: Download build artifact 📥 | |
uses: actions/download-artifact@v2 | |
with: | |
name: build-folder | |
path: docs/build/ | |
- name: Deploy 🚀 | |
uses: JamesIves/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
branch: gh-pages # The branch the action should deploy to. | |
folder: docs/build # The folder the action should deploy. The same as in "Download Build" step. | |
clean: true # Automatically remove deleted files from the deploy branch |