-
Notifications
You must be signed in to change notification settings - Fork 68
45 lines (43 loc) · 1.23 KB
/
update_posts.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
name: Update wiki posts
on:
workflow_dispatch:
push:
branches:
- "main"
jobs:
update-posts:
runs-on: ubuntu-latest
name: "Update posts"
steps:
- name: Clone posts repository
uses: actions/checkout@v3
with:
clean: true
path: "posts"
token: ${{ secrets.CI_TOKEN }}
- name: Clone wiki repository
uses: actions/checkout@v3
with:
clean: true
repository: "liberty-mp/wiki-website"
path: "wiki"
ref: "main"
token: ${{ secrets.CI_TOKEN }}
- name: Update posts
if: always()
shell: bash
run: |
mkdir ./wiki/new_wiki
mv -f ./wiki/wiki/.vitepress ./wiki/new_wiki
mv -f ./wiki/wiki/public ./wiki/new_wiki
mv -f ./wiki/wiki/vite.config.ts ./wiki/new_wiki
mv -f ./posts/* ./wiki/new_wiki
rm -rf ./wiki/wiki
mv -f ./wiki/new_wiki ./wiki/wiki
cd wiki
git config --global user.email "[email protected]"
git config --global user.name "liberty.mp"
git status
git add .
git commit -m "Update posts with ${{ github.sha }}" || true
git push || true