-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (63 loc) · 2.15 KB
/
deploy-gh-pages.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
name: Build and Deploy to GitHub Pages
on:
# trigger manually for now
workflow_dispatch:
# push:
# branches:
# - master
jobs:
build:
runs-on: ["runs-on","runner=2cpu-linux-x64","image=ubuntu24-amd64"]
steps:
# Step 1: Checkout the main repository (your current project)
- name: Checkout this repository
uses: actions/checkout@v3
with:
ref: master
# - name: Check GITHUB_TOKEN Permissions
# run: |
# echo "Testing GitHub Token Access"
# git ls-remote https://x-access-token:${{ secrets.ORG_PAT }}@github.com/zml/zml.git
# Step 2: Checkout the ZML repository into a separate folder
- name: Checkout ZML repository
uses: actions/checkout@v3
with:
repository: zml/zml
token: ${{ secrets.ORG_PAT }}
path: zml
ref: master
# Step 3: Set up Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
# setup zig
- uses: goto-bus-stop/setup-zig@v2
with:
version: 0.13.0
- name: unfck ssh auth
run: ssh-keyscan github.com >> ~/.ssh/known_hosts
# Step 5: Run your scripts to build the static website with Zine
- name: Run build scripts
run: |
./01-PREPARE-FOR-EDITS.sh
./02-BUILD.sh
# Step 6: Checkout the docs branch
- name: Checkout the docs branch
uses: actions/checkout@v3
with:
ref: docs # The branch that will hold the generated GitHub Pages content
path: gh-pages # Work in a separate directory to avoid conflicts
# Step 7: Copy the generated files to the docs branch
- name: Copy generated files
run: |
cp -r WORKSPACE/zig-out/* gh-pages/
cd gh-pages
# Step 8: Commit and push changes to the docs branch
- name: Commit and push changes
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git add .
git commit -m "Update GitHub Pages"
git push origin docs