Skip to content

Commit dc75551

Browse files
committed
update deploy workflow and pull from alshedivat/al-folio
1 parent 05d7587 commit dc75551

File tree

5 files changed

+123
-43
lines changed

5 files changed

+123
-43
lines changed

.github/workflows/deploy.yml

Lines changed: 86 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,101 @@
1-
name: deploy
1+
name: Deploy site
22

33
on:
44
push:
55
branches:
66
- master
77
- main
8+
paths:
9+
- "assets/**"
10+
- "**.bib"
11+
- "**.html"
12+
- "**.js"
13+
- "**.liquid"
14+
- "**/*.md"
15+
- "**.yml"
16+
- "Gemfile"
17+
- "Gemfile.lock"
18+
- "!.github/workflows/axe.yml"
19+
- "!.github/workflows/broken-links.yml"
20+
- "!.github/workflows/deploy-docker-tag.yml"
21+
- "!.github/workflows/deploy-image.yml"
22+
- "!.github/workflows/docker-slim.yml"
23+
- "!.github/workflows/lighthouse-badger.yml"
24+
- "!.github/workflows/prettier.yml"
25+
- "!lighthouse_results/**"
26+
- "!CONTRIBUTING.md"
27+
- "!CUSTOMIZE.md"
28+
- "!FAQ.md"
29+
- "!INSTALL.md"
30+
- "!README.md"
831
pull_request:
932
branches:
1033
- master
1134
- main
35+
paths:
36+
- "assets/**"
37+
- "**.bib"
38+
- "**.html"
39+
- "**.js"
40+
- "**.liquid"
41+
- "**/*.md"
42+
- "**.yml"
43+
- "Gemfile"
44+
- "Gemfile.lock"
45+
- "!.github/workflows/axe.yml"
46+
- "!.github/workflows/broken-links.yml"
47+
- "!.github/workflows/deploy-docker-tag.yml"
48+
- "!.github/workflows/deploy-image.yml"
49+
- "!.github/workflows/docker-slim.yml"
50+
- "!.github/workflows/lighthouse-badger.yml"
51+
- "!.github/workflows/prettier.yml"
52+
- "!lighthouse_results/**"
53+
- "!CONTRIBUTING.md"
54+
- "!CUSTOMIZE.md"
55+
- "!FAQ.md"
56+
- "!INSTALL.md"
57+
- "!README.md"
58+
workflow_dispatch:
59+
60+
permissions:
61+
contents: write
1262

1363
jobs:
1464
deploy:
65+
# available images: https://github.com/actions/runner-images#available-images
1566
runs-on: ubuntu-latest
1667
steps:
17-
- name: Checkout code
18-
uses: actions/checkout@v3
19-
- name: Setup Ruby
20-
uses: ruby/setup-ruby@v1
21-
with:
22-
ruby-version: '3.0.2'
23-
bundler-cache: true
24-
- name: Install deps
25-
run: |
26-
npm install -g mermaid.cli
27-
- name: Setup deploy options
28-
id: setup
29-
run: |
30-
git config --global user.name "GitHub Action"
31-
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
32-
if [[ ${GITHUB_REF} = refs/pull/*/merge ]]; then # pull request
33-
echo "::set-output name=SRC_BRANCH::${GITHUB_HEAD_REF}"
34-
echo "::set-output name=NO_PUSH::--no-push"
35-
elif [[ ${GITHUB_REF} = refs/heads/* ]]; then # branch, e.g. master, source etc
36-
echo "::set-output name=SRC_BRANCH::${GITHUB_REF#refs/heads/}"
37-
fi
38-
echo "::set-output name=DEPLOY_BRANCH::gh-pages"
39-
- name: Deploy website
40-
run: yes | bash bin/deploy --verbose ${{ steps.setup.outputs.NO_PUSH }}
41-
--src ${{ steps.setup.outputs.SRC_BRANCH }}
42-
--deploy ${{ steps.setup.outputs.DEPLOY_BRANCH }}
68+
- name: Checkout 🛎️
69+
uses: actions/checkout@v4
70+
- name: Setup Ruby 💎
71+
uses: ruby/setup-ruby@v1
72+
with:
73+
ruby-version: "3.3.5"
74+
bundler-cache: true
75+
- name: Setup Python 🐍
76+
uses: actions/setup-python@v5
77+
with:
78+
python-version: "3.13"
79+
cache: "pip" # caching pip dependencies
80+
- name: Update _config.yml ⚙️
81+
uses: fjogeleit/yaml-update-action@main
82+
with:
83+
commitChange: false
84+
valueFile: "_config.yml"
85+
propertyPath: "giscus.repo"
86+
value: ${{ github.repository }}
87+
- name: Install and Build 🔧
88+
run: |
89+
sudo apt-get update && sudo apt-get install -y imagemagick
90+
pip3 install --upgrade nbconvert
91+
export JEKYLL_ENV=production
92+
bundle exec jekyll build
93+
- name: Purge unused CSS 🧹
94+
run: |
95+
npm install -g purgecss
96+
purgecss -c purgecss.config.js
97+
- name: Deploy 🚀
98+
if: github.event_name != 'pull_request'
99+
uses: JamesIves/github-pages-deploy-action@v4
100+
with:
101+
folder: _site

Gemfile

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,36 @@
11
source 'https://rubygems.org'
2+
3+
gem 'jekyll'
4+
5+
# Core plugins that directly affect site building
26
group :jekyll_plugins do
3-
gem 'jekyll'
47
gem 'jekyll-archives'
5-
gem 'jekyll-diagrams'
68
gem 'jekyll-email-protect'
79
gem 'jekyll-feed'
10+
gem 'jekyll-get-json'
811
gem 'jekyll-imagemagick'
12+
gem 'jekyll-jupyter-notebook'
13+
gem 'jekyll-link-attributes'
914
gem 'jekyll-minifier'
1015
gem 'jekyll-paginate-v2'
16+
gem 'jekyll-regex-replace'
1117
gem 'jekyll-scholar'
1218
gem 'jekyll-sitemap'
13-
gem 'jekyll-target-blank'
19+
gem 'jekyll-tabs'
20+
gem 'jekyll-toc'
1421
gem 'jekyll-twitter-plugin'
15-
gem 'jekyll-redirect-from'
1622
gem 'jemoji'
17-
gem 'mini_racer'
18-
gem 'unicode_utils'
19-
gem 'webrick'
20-
gem 'jekyll-loading-lazy'
23+
24+
gem 'classifier-reborn' # used for content categorization during the build
2125
end
26+
27+
# Gems for development or external data fetching (outside :jekyll_plugins)
2228
group :other_plugins do
23-
gem 'httparty'
29+
gem 'css_parser'
2430
gem 'feedjira'
31+
gem 'httparty'
32+
gem 'observer' # used by jekyll-scholar
33+
gem 'ostruct' # used by jekyll-twitter-plugin
34+
# gem 'unicode_utils' -- should be already installed by jekyll
35+
# gem 'webrick' -- should be already installed by jekyll
2536
end

_config.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,22 +160,25 @@ keep_files:
160160
- .nojekyll
161161
- .git
162162

163+
# Plug-ins
163164
# Plug-ins
164165
plugins:
165166
- jekyll-archives
166-
- jekyll-diagrams
167167
- jekyll-email-protect
168168
- jekyll-feed
169+
- jekyll-get-json
169170
- jekyll-imagemagick
171+
- jekyll-jupyter-notebook
172+
- jekyll-link-attributes
170173
- jekyll-minifier
171174
- jekyll-paginate-v2
175+
- jekyll-regex-replace
172176
- jekyll/scholar
173177
- jekyll-sitemap
174-
- jekyll-target-blank
178+
- jekyll-tabs
179+
- jekyll-toc
175180
- jekyll-twitter-plugin
176-
- jekyll-redirect-from
177181
- jemoji
178-
- jekyll-loading-lazy
179182

180183
# Sitemap settings
181184
defaults:
@@ -269,9 +272,9 @@ imagemagick:
269272
# Jekyll Diagrams
270273
# -----------------------------------------------------------------------------
271274

272-
jekyll-diagrams:
273-
# configuration, see https://github.com/zhustec/jekyll-diagrams.
274-
# feel free to comment out this section if not using jekyll diagrams.
275+
# jekyll-diagrams:
276+
# # configuration, see https://github.com/zhustec/jekyll-diagrams.
277+
# # feel free to comment out this section if not using jekyll diagrams.
275278

276279

277280
# -----------------------------------------------------------------------------

purgecss.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
content: ["_site/**/*.html", "_site/**/*.js"],
3+
css: ["_site/assets/css/*.css"],
4+
output: "_site/assets/css/",
5+
skippedContentGlobs: ["_site/assets/**/*.html"],
6+
};

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nbconvert

0 commit comments

Comments
 (0)