-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (43 loc) · 1.42 KB
/
deploy.yaml
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
name: Deploy to GitHub Pages
on:
push:
branches:
- main # Change this to your default branch if it's not 'main'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22' # Use the appropriate version of Go
- name: Install Docute
run: |
go install github.com/JackalLabs/docute@83fb2992d8de52b19b75a164b0d910fc59799e0f
- name: Run Go executable
run: |
docute generate --base="/book/" -t "Jackal Docs"
- name: Setup Node.js (for Git commands)
uses: actions/setup-node@v3
with:
node-version: '14'
- name: Deploy to gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Configure git
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
if git show-ref --quiet refs/heads/gh-pages; then
git checkout gh-pages
else
git checkout --orphan gh-pages
fi
git rm -rf .
# Copy new content to the gh-pages branch
cp -r .out/* .
git add .
git commit -m "Deploy to gh-pages"
git push origin gh-pages --force