-
Notifications
You must be signed in to change notification settings - Fork 13
60 lines (47 loc) · 1.55 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
name: Build VitePress, Pull Types, and Push to Private Repo
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18.17.1'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Pull types from type repo
env:
TYPE_REPO_TOKEN: ${{ secrets.TYPE_REPO_TOKEN }}
run: |
git clone --depth 1 https://${TYPE_REPO_TOKEN}@github.com/CrychicTeam/CrychicDocTypes.git type_repo
cp -r type_repo/typefiles .
rm -rf type_repo
- name: Build VitePress site
run: npm run docs:build
- name: Clean up typefiles
run: rm -rf typefiles
- name: Push to private repo
env:
PRIVATE_REPO_TOKEN: ${{ secrets.PRIVATE_REPO_TOKEN }}
run: |
cd .vitepress/dist
git init
git config user.name "GitHub Actions Bot"
git config user.email "<>"
git clone --depth 1 https://${PRIVATE_REPO_TOKEN}@github.com/CrychicTeam/CrychicDocSynchronization.git temp_repo
if [ -d temp_repo/.github ]; then
cp -r temp_repo/.github .
fi
rm -rf temp_repo
git add -A
git commit -m "Update documentation"
git push --force https://${PRIVATE_REPO_TOKEN}@github.com/CrychicTeam/CrychicDocSynchronization.git HEAD:main
cd ../..
rm -rf .vitepress/dist