Skip to content

Main pnpm

Main pnpm #319

name: GitHub Pages Preview
on:
pull_request:
types: [opened, synchronize]
jobs:
deploy:
name: Deploy Preview branch on Github.io
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Get branch name
id: branch-name
uses: tj-actions/[email protected]
- name: Set .homepage in package.json
uses: jossef/action-set-json-field@v2
with:
file: apps/demo/package.json
field: homepage
value: libraries/${{ steps.branch-name.outputs.current_branch }}
- name: 🥖 Build the React App
env:
REACT_APP_BASENAME: libraries/${{ steps.branch-name.outputs.current_branch }}
run: |
yarn
yarn build --filter demo
- name: 🍿 Deploy
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./apps/demo/build
destination_dir: ./${{ steps.branch-name.outputs.current_branch }}
- name: Link to preview build in PR
uses: marocchino/sticky-pull-request-comment@v2
with:
message: |
Preview app available at <https://crystallizeapi.github.io/libraries/${{ steps.branch-name.outputs.current_branch }}>