ci: move to pnpm #750
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: Website Deployment | |
on: | |
release: | |
types: [published] | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
deploy: | |
description: Deploy website | |
required: false | |
default: true | |
type: boolean | |
jobs: | |
print-env: | |
runs-on: ubuntu-latest | |
steps: | |
- run: | | |
echo "deploy=${{ github.event.inputs.deploy || false }}" | |
build-package: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8.4.0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: pnpm | |
- run: pnpm install --frozen-lockfile | |
- run: pnpm --filter react-day-picker run build | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: rdp-dist | |
path: packages/react-day-picker/dist | |
test-website: | |
needs: [build-package] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8.4.0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: pnpm | |
- uses: actions/download-artifact@v3 | |
with: | |
name: rdp-dist | |
path: packages/react-day-picker/dist | |
- run: pnpm install --frozen-lockfile | |
- run: pnpm --filter website run typecheck | |
- run: pnpm --filter website run lint --max-warnings=0 | |
- run: pnpm --filter website run test | |
build-website: | |
needs: [build-package] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8.4.0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: pnpm | |
- uses: actions/download-artifact@v3 | |
with: | |
name: rdp-dist | |
path: packages/react-day-picker/dist | |
- run: pnpm install --frozen-lockfile | |
- run: pnpm --filter website run build | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: website-build | |
path: website/build | |
deploy: | |
runs-on: ubuntu-latest | |
needs: [build-website, test-website] | |
if: ${{ github.event_name == 'release' || github.event.inputs.deploy }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8.4.0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
registry-url: https://registry.npmjs.org/ | |
- uses: actions/download-artifact@v3 | |
with: | |
name: website-build | |
path: website/build | |
- uses: actions/download-artifact@v3 | |
with: | |
name: rdp-dist | |
path: packages/react-day-picker/dist | |
- run: pnpm install --frozen-lockfile | |
- uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: website/build | |
user_name: github-actions[bot] | |
user_email: 41898282+github-actions[bot]@users.noreply.github.com |