Skip to content

Commit

Permalink
ci: publish to Cloudflare Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryolitia committed Mar 19, 2024
1 parent 91715c3 commit c3a94a9
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 7 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Build and deploy

on:
push:
branches:
- 'main'
paths:
- ".github/**"
- ".vitepress/**"
Expand Down Expand Up @@ -83,10 +85,3 @@ jobs:
run: |
sed -e "s/BUILD_TIME/$(TZ=Asia/Shanghai date -Isecond)/" -e "s/COMMIT_SHA/${{ github.sha }}/" -i src/about.md
npm run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ".vitepress/dist/"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
37 changes: 37 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish Cloudflare Pages

on:
push:
branches:
- 'main'

jobs:
build:
name: Build and deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v3
with:
version: latest
- uses: actions/setup-node@v4
with:
cache: npm
- name: Install
run: npm ci
- name: Build
run: |
sed -e "s/BUILD_TIME/$(TZ=Asia/Shanghai date -Isecond)/" -e "s/COMMIT_SHA/${{ github.sha }}/" -i src/about.md
npm run docs:build
env:
NODE_OPTIONS: --max_old_space_size=4096
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_PAGES_ACCOUNT }}
projectName: proskynova-github-io
directory: .vitepress/dist
wranglerVersion: '3'

0 comments on commit c3a94a9

Please sign in to comment.