File tree Expand file tree Collapse file tree 2 files changed +57
-0
lines changed
Expand file tree Collapse file tree 2 files changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Zola Deploy
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ jobs :
9+ build-and-deploy :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Checkout source
13+ uses : actions/checkout@v4
14+ with :
15+ submodules : recursive
16+
17+ # Install dependencies
18+ - name : Install dependencies
19+ run : |
20+ sudo apt-get update
21+ sudo apt-get install -y curl unzip rsync git
22+
23+ # Install Zola
24+ - name : Install Zola
25+ run : |
26+ curl -s -L https://github.com/getzola/zola/releases/download/v0.21.0/zola-v0.21.0-x86_64-unknown-linux-musl.tar.gz \
27+ | sudo tar xvzf - -C /usr/local/bin
28+ zola --version
29+
30+ # Build site
31+ - name : Build site
32+ run : zola build --output-dir publish_tmp --force
33+
34+ # Deploy to submodule repo
35+ - name : Deploy to public submodule
36+ env :
37+ GH_TOKEN : ${{ secrets.GH_TOKEN }}
38+ run : |
39+ TIMESTAMP=$(date '+%Y-%m-%d %I:%M:%S %p')
40+ rsync -av --delete --exclude='.git' --exclude="CNAME" publish_tmp/ public/
41+ cd public
42+ git checkout main
43+ git pull origin main
44+ git add .
45+ git commit -m "Automated Deploy: $TIMESTAMP" || echo "No changes to deploy."
46+ git push https://tr1xem:${GH_TOKEN}@github.com/tr1xem/tr1xem.github.io.git main
47+ cd ..
48+
49+ # Commit source repo changes if any
50+ - name : Commit source repo
51+ env :
52+ GH_TOKEN : ${{ secrets.GH_TOKEN }}
53+ run : |
54+ TIMESTAMP=$(date '+%Y-%m-%d %I:%M:%S %p')
55+ git add .
56+ git commit -m "Automated Commit: $TIMESTAMP" || echo "No source changes."
57+ git push https://${GH_TOKEN}@github.com/tr1xem/tr1xem.git main
File renamed without changes.
You can’t perform that action at this time.
0 commit comments