2024-01-28 00:10:16 +08:00
|
|
|
name: deploy
|
2024-01-02 01:07:28 +08:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: ['main']
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
jobs:
|
2024-01-28 00:10:16 +08:00
|
|
|
deploy:
|
2024-01-02 01:07:28 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 20
|
|
|
|
|
|
|
|
- uses: pnpm/action-setup@v2
|
|
|
|
- run: pnpm -v
|
|
|
|
|
|
|
|
- run: pnpm install
|
|
|
|
|
2024-02-01 21:01:49 +08:00
|
|
|
- run: pnpm -F @gkd-kit/docs exec tsx ./.vitepress/scripts/updateVersion.ts
|
|
|
|
|
|
|
|
- run: pnpm -F @gkd-kit/api run predocs:dev
|
|
|
|
- run: pnpm -F @gkd-kit/docs run docs:build-mirror
|
2024-01-02 01:07:28 +08:00
|
|
|
|
|
|
|
- name: Publish package
|
|
|
|
run: |
|
|
|
|
pnpm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
|
2024-02-01 21:01:49 +08:00
|
|
|
pnpm -F @gkd-kit/docs publish --no-git-checks
|
2024-01-02 01:07:28 +08:00
|
|
|
|
|
|
|
- run: curl -X PUT 'https://registry-direct.npmmirror.com/@gkd-kit/docs/sync'
|
|
|
|
|
2024-01-28 00:10:16 +08:00
|
|
|
- uses: cloudflare/pages-action@v1
|
2024-01-02 01:07:28 +08:00
|
|
|
with:
|
2024-01-28 00:10:16 +08:00
|
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
|
|
projectName: gkd-docs
|
2024-02-01 21:01:49 +08:00
|
|
|
directory: ./docs/.vitepress/dist
|