Build static page and upload to Cloudflare Pages #3
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 static page and upload to Cloudflare Pages | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8.12.1 | |
- uses: actions/setup-node@v4 | |
with: | |
cache: 'pnpm' | |
cache-dependency-path: 'pnpm-lock.yaml' | |
node-version-file: '.nvmrc' | |
- name: Install project dependencies | |
run: pnpm install --frozen-lockfile | |
- run: pnpm build | |
- name: Publish to Cloudflare Pages | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }} | |
directory: ./dist |