feat: add github pages auto-deploy #8
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: Build and deploy examples | |
on: [pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
# cache: 'yarn' | |
- name: Install Yarn | |
run: npm install -g yarn | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: yarn-deps-${{ hashFiles('yarn.lock') }} | |
restore-keys: | | |
yarn-deps-${{ hashFiles('yarn.lock') }} | |
- run: yarn install --frozen-lockfile | |
- name: Build libraries | |
run: yarn build | |
- name: Build example playgrounds | |
run: echo "SUB PATH IS $SUB_PATH" && yarn build:playgrounds -- -- --public-url=/recommend/pr-preview/pr-${{ github.event.number }}/demo/dist/ | |
env: | |
SUB_PATH: /recommend/pr-preview/pr-${{ github.event.number }}/demo/dist/ | |
- name: Deploy preview | |
uses: rossjrw/pr-preview-action@v1 | |
with: | |
source-dir: ./examples/ |