ci: add cf pages

This commit is contained in:
Reorx 2023-02-09 00:03:46 +08:00
parent 3e6c9c2299
commit daca917858
1 changed files with 34 additions and 0 deletions

34
.github/workflows/cf-pages.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: CF Pages
on:
push:
branches:
- master
paths-ignore:
- "README.md"
jobs:
deploy:
runs-on: ubuntu-20.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
- run: npm install
- run: npm run build-site
- name: Publish
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: jsoncv
directory: src/dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}