Skip to content

Commit aa1506a

Browse files
committed
Added github action to publish website to gh pages.
1 parent 96f7be3 commit aa1506a

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build and Deploy Pelican Site
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.x'
18+
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '16'
23+
24+
- name: Install Node.js dependencies
25+
run: |
26+
npm install -g less
27+
28+
- name: Install Python dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install pelican markdown
32+
pip install fabric3 livereload
33+
34+
- name: Build site
35+
run: |
36+
lessc themes/mombacho/static/css/style.less -x > themes/mombacho/static/css/style.min.css
37+
pelican -s publishconf.py
38+
cp -r extra/* output/ || true
39+
cp -r extra/.htaccess output/ || true
40+
41+
- name: Deploy to GitHub Pages
42+
uses: peaceiris/actions-gh-pages@v3
43+
with:
44+
github_token: ${{ secrets.GITHUB_TOKEN }}
45+
publish_dir: ./output
46+
publish_branch: gh-pages

0 commit comments

Comments
 (0)