Skip to content

Commit d6a7970

Browse files
Create build.yml
1 parent 3d889c5 commit d6a7970

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/build.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: build site using Pelican
2+
on:
3+
push:
4+
branches: [main]
5+
paths-ignore:
6+
- static/**
7+
jobs:
8+
build-site:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: clone repo
12+
uses: actions/checkout@v3
13+
with:
14+
submodules: recursive
15+
- name: pull theme repo
16+
run: |
17+
cd pelicantheme
18+
git fetch --all
19+
git reset --hard origin/main
20+
cd ..
21+
- name: set up python
22+
uses: actions/setup-python@v3
23+
with:
24+
python-version: 3.11.x
25+
- name: install dependencies
26+
run: |
27+
python3 -m pip install -U pip
28+
python3 -m pip install -r requirements.txt
29+
- name: clean old outputs
30+
run: |
31+
rm -rf drafts/
32+
rm -rf images/
33+
- name: build
34+
run: python3 build.py
35+
- name: commit changes # copied from ad-m/github-push-action
36+
run: |
37+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
38+
git config --local user.name "github-actions[bot]"
39+
git add -A
40+
git commit -m "built website" -a
41+
- name: push built files
42+
uses: ad-m/github-push-action@40bf560936a8022e68a3c00e7d2abefaf01305a6
43+
with:
44+
github_token: ${{ secrets.GITHUB_TOKEN }}
45+
branch: ${{ github.ref }}

0 commit comments

Comments
 (0)