Skip to content

Commit 8286de6

Browse files
committed
Implement automatic website builds
1 parent 250f96b commit 8286de6

File tree

2 files changed

+55
-3
lines changed

2 files changed

+55
-3
lines changed

.github/workflows/build.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build website
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "main"
7+
types:
8+
- closed
9+
10+
#workflow_dispatch:
11+
12+
#push:
13+
# branches:
14+
# - 'main'
15+
# paths:
16+
# - './templates/**'
17+
18+
concurrency:
19+
group: "builders"
20+
cancel-in-progress: true
21+
22+
jobs:
23+
if_merged:
24+
if: github.event.pull_request.merged == true
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
with:
30+
ref: main
31+
fetch-depth: 0
32+
- name: Install dependencies
33+
run: |
34+
curl -sSL https://install.python-poetry.org | python3 -
35+
make install
36+
- name: Build website
37+
run: make website
38+
- name: Commit files
39+
run: |
40+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
41+
git config --local user.name "github-actions[bot]"
42+
git commit -a -m "Built website"
43+
- name: Push changes
44+
uses: ad-m/github-push-action@master
45+
with:
46+
branch: main

.github/workflows/pages.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@ name: Deploy static content to Pages
33

44
on:
55
# Runs on pushes targeting the default branch
6-
push:
7-
branches: ["main"]
6+
#push:
7+
# branches: ["main"]
88

99
# Allows you to run this workflow manually from the Actions tab
1010
workflow_dispatch:
1111

12+
workflow_run:
13+
workflows:
14+
- Build website
15+
types:
16+
- completed
17+
1218
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1319
permissions:
1420
contents: read
@@ -36,7 +42,7 @@ jobs:
3642
uses: actions/upload-pages-artifact@v1
3743
with:
3844
# Upload entire repository
39-
path: './public/'
45+
path: "./public/"
4046
- name: Deploy to GitHub Pages
4147
id: deployment
4248
uses: actions/deploy-pages@v2

0 commit comments

Comments
 (0)