docs/.github/workflows/deploy.yml

47 lines
1.2 KiB
YAML
Raw Normal View History

2024-01-28 00:10:16 +08:00
name: deploy
2024-01-02 01:07:28 +08:00
on:
2024-10-20 00:50:05 +08:00
workflow_dispatch:
2024-01-02 01:07:28 +08:00
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:
2024-07-04 23:23:54 +08:00
- uses: actions/checkout@v4
2024-01-02 01:07:28 +08:00
2024-07-04 23:23:54 +08:00
- uses: actions/setup-node@v4
2024-01-02 01:07:28 +08:00
with:
node-version: 20
2024-07-04 23:23:54 +08:00
- uses: pnpm/action-setup@v4
2024-01-02 01:07:28 +08:00
- 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
2024-07-03 11:23:32 +08:00
- run: pnpm -F @gkd-kit/api run predocs:build
2024-02-01 21:01:49 +08:00
- run: pnpm -F @gkd-kit/docs run docs:build-mirror
2024-10-20 00:50:05 +08:00
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
2024-02-01 21:16:00 +08:00
- run: |
curl -X PUT 'https://registry-direct.npmmirror.com/@gkd-kit/docs/sync'
sleep 5
curl https://registry.npmmirror.com/@gkd-kit/docs/latest/files/package.json
2024-01-02 01:07:28 +08:00
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