ci: direct upload to Cloudflare Pages #1
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: Deploy | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
build: | |
name: Build | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
deployments: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Setup pnpm | |
uses: pnpm/[email protected] | |
with: | |
version: 8.5.1 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: "pnpm" | |
- name: Run install | |
run: pnpm install | |
- name: Run docs:build | |
run: pnpm docs:build | |
- name: Upload to Cloudflare Pages | |
uses: cloudflare/pages-action@1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: klass | |
directory: docs/.vitepress/dist | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} |