-
Notifications
You must be signed in to change notification settings - Fork 84
90 lines (76 loc) · 2.62 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Deploy
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
- id: cache
name: Yarn Cache Dir
run: echo "value=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Restore Lockfile
uses: actions/cache@v3
with:
path: yarn.lock
key: yarn-lock-${{ github.sha }}
restore-keys: yarn-lock-
- name: Restore Cache
uses: actions/cache@v3
with:
path: ${{ steps.cache.outputs.value }}
key: yarn-cache-${{ github.sha }}
restore-keys: yarn-cache-
- name: Install
run: yarn
- name: Upload Lockfile
uses: actions/upload-artifact@v3
with:
name: lockfile
path: yarn.lock
- name: Build (koishi-plugin-docs)
run: yarn build
env:
DEPLOY_BASE: /dist-docs/
- name: Deploy (koishi-plugin-docs)
if: ${{ github.repository == 'koishijs/docs' && github.ref == 'refs/heads/main' }}
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.WORKFLOW_TOKEN }}
publish_branch: dist-docs
publish_dir: .vitepress/dist
force_orphan: true
enable_jekyll: true
commit_message: '[skip ci] deploy'
- name: Sync (koishi-plugin-docs)
if: ${{ github.repository == 'koishijs/docs' && github.ref == 'refs/heads/main' }}
run: >
curl -L
-X POST
-H "Accept: application/vnd.github+json"
-H "Authorization: Bearer ${{ secrets.WORKFLOW_TOKEN }}"
https://api.github.com/repos/koishijs/koishi-plugin-docs/actions/workflows/build.yml/dispatches
-d '{"ref":"main"}'
- name: Build
if: ${{ github.repository == 'koishijs/docs' && github.ref == 'refs/heads/main' }}
run: yarn build
env:
MEILISEARCH_HOST: ${{ secrets.MEILISEARCH_HOST }}
MEILISEARCH_READ_KEY: ${{ secrets.MEILISEARCH_READ_KEY }}
MEILISEARCH_WRITE_KEY: ${{ secrets.MEILISEARCH_WRITE_KEY }}
- name: Deploy
if: ${{ github.repository == 'koishijs/docs' && github.ref == 'refs/heads/main' }}
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.WORKFLOW_TOKEN }}
external_repository: koishi-bot/koishi
publish_branch: pages
publish_dir: .vitepress/dist
force_orphan: true
enable_jekyll: true
commit_message: '[skip ci] deploy'