Skip to content

Commit b2ac856

Browse files
authored
Merge pull request #87 from gperdrizet/dev
Set-up test build workflow
2 parents 7e2daf2 + 428f23b commit b2ac856

File tree

3 files changed

+136
-0
lines changed

3 files changed

+136
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Workflow for building a Jekyll site for deployment to GitHub Pages
2+
name: GitHub pages build
3+
4+
# Runs on pull request creation
5+
on:
6+
pull_request:
7+
types: [opened, reopened]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent build, skipping runs queued between the run in-progress and latest queued.
19+
concurrency:
20+
group: "build-pages"
21+
cancel-in-progress: false
22+
23+
jobs:
24+
# Build job
25+
build:
26+
name: Test build pages site
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
- name: Setup Pages
32+
uses: actions/configure-pages@v5
33+
34+
- name: Create _site directory
35+
run: mkdir -p ./site/_site
36+
37+
- name: Create notebooks directory
38+
run: mkdir -p ./site/assets/notebooks
39+
- name: Move notebooks into build directory
40+
run: cp -r ./notebooks/* ./site/assets/notebooks/
41+
- name: Move notebook config file into build directory
42+
run: cp -r ./notebooks/notebooks.yml ./site/_data/
43+
44+
- name: Create data directory
45+
run: mkdir -p ./site/assets/data
46+
- name: Move datasets into build directory
47+
run: cp -r ./data/* ./site/assets/data/
48+
- name: Move dataset config file into build directory
49+
run: cp -r ./data/datasets.yml ./site/_data/
50+
51+
- name: Move resources page into build directory
52+
run: cp ./resources.md ./site/
53+
54+
- name: Build with Jekyll
55+
uses: actions/jekyll-build-pages@v1
56+
with:
57+
source: ./site
58+
destination: ./site/_site
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Sample workflow for deploying a Jekyll site to GitHub Pages
2+
name: GitHub pages deployment
3+
4+
# Runs on pushes targeting the default branch
5+
on:
6+
push:
7+
branches: ["main"]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "deploy-pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
# Build job
26+
build:
27+
name: Build pages site
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
- name: Setup Pages
33+
uses: actions/configure-pages@v5
34+
35+
- name: Create _site directory
36+
run: mkdir -p ./site/_site
37+
38+
- name: Create notebooks directory
39+
run: mkdir -p ./site/assets/notebooks
40+
- name: Move notebooks into build directory
41+
run: cp -r ./notebooks/* ./site/assets/notebooks/
42+
- name: Move notebook config file into build directory
43+
run: cp -r ./notebooks/notebooks.yml ./site/_data/
44+
45+
- name: Create data directory
46+
run: mkdir -p ./site/assets/data
47+
- name: Move datasets into build directory
48+
run: cp -r ./data/* ./site/assets/data/
49+
- name: Move dataset config file into build directory
50+
run: cp -r ./data/datasets.yml ./site/_data/
51+
52+
- name: Move resources page into build directory
53+
run: cp ./resources.md ./site/
54+
55+
- name: Build with Jekyll
56+
uses: actions/jekyll-build-pages@v1
57+
with:
58+
source: ./site
59+
destination: ./site/_site
60+
61+
- name: Upload artifact
62+
uses: actions/upload-pages-artifact@v3
63+
with:
64+
path: ./site/_site
65+
66+
# Deployment job
67+
deploy:
68+
name: Deploy pages site
69+
environment:
70+
name: github-pages
71+
url: ${{ steps.deployment.outputs.page_url }}
72+
runs-on: ubuntu-latest
73+
needs: build
74+
steps:
75+
- name: Deploy to GitHub Pages
76+
id: deployment
77+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
__pycache__
2+
.ruby-lsp
23
*.ipynb_checkpoints
34
.venv
45
.vscode

0 commit comments

Comments
 (0)