Skip to content

Commit da75a97

Browse files
committed
Implement GitHub Pages CI workflow
1 parent c39a39d commit da75a97

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed

.github/workflows/main.yml

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Deploy Jekyll site to Pages
2+
3+
on:
4+
# Runs on pushes targeting the default branch
5+
push:
6+
branches: [master]
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
19+
concurrency:
20+
group: "pages"
21+
cancel-in-progress: false
22+
23+
jobs:
24+
build:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- uses: actions/setup-node@v4
31+
with:
32+
cache: 'npm'
33+
34+
- name: Setup Ruby
35+
uses: ruby/setup-ruby@v1
36+
with:
37+
ruby-version: '3.3' # Not needed with a `.ruby-version` or `.tool-versions`
38+
bundler-cache: true # runs 'bundler install' and caches installed gems automatically
39+
cache-version: 0 # Increment this number if you need to re-download cached gems
40+
41+
- name: Setup Pages
42+
id: pages
43+
uses: actions/configure-pages@v5
44+
45+
- name: Fetch ImageMagick ETag
46+
id: fetch-magick-etag
47+
run: |
48+
echo "etag=$(./fetch-magick-etag.sh)" >> "$GITHUB_OUTPUT"
49+
50+
- name: Restore ImageMagick
51+
id: restore-magick
52+
uses: actions/cache@v4
53+
with:
54+
path: |
55+
bin/magick
56+
bin/magick-etag
57+
key: magick-${{ steps.fetch-magick-etag.outputs.etag }}
58+
59+
- name: Fetch Inkscape version
60+
id: fetch-inkscape-version
61+
run: |
62+
echo "version=$(./fetch-inkscape-version.sh)" >> "$GITHUB_OUTPUT"
63+
64+
- name: Restore Inkscape
65+
id: restore-inkscape
66+
uses: actions/cache@v4
67+
with:
68+
path: |
69+
bin/inkscape
70+
bin/inkscape-version
71+
key: inkscape-${{ steps.fetch-inkscape-version.outputs.version }}
72+
73+
- name: Build
74+
env:
75+
JEKYLL_ENV: production
76+
run: |
77+
./build.sh --fetch-deps --baseurl "${{ steps.pages.outputs.base_path }}"
78+
79+
- name: Upload artifact
80+
uses: actions/upload-pages-artifact@v3
81+
82+
deploy:
83+
runs-on: ubuntu-latest
84+
needs: build
85+
environment:
86+
name: github-pages
87+
url: ${{ steps.deployment.outputs.page_url }}
88+
steps:
89+
- name: Deploy to GitHub Pages
90+
id: deployment
91+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)