Skip to content

Commit 29c7f4a

Browse files
committed
Remove jekyll-assets and migrate to new build workflow
The existing one was flaky recently, probably due to the docker container using an older Ruby version, and sometimes pulling in latest nokogiri which required a newer version. octoprint.org builds happily directly on Actions w/o docker, so let's see if this doesn't work here as well. Also no longer push commits into master and instead use the github pages workflow.
1 parent bd40c7c commit 29c7f4a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+383
-104
lines changed
+33-66
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build, validate & publish page
1+
name: Build, validate & deploy page
22

33
on:
44
schedule:
@@ -12,18 +12,11 @@ on:
1212
workflow_dispatch:
1313

1414
jobs:
15-
build-validate-and-publish:
16-
name: Publish to Github Pages
15+
build:
16+
name: Build and validate
1717
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/checkout@v3
20-
with:
21-
path: src
22-
23-
- uses: actions/checkout@v3
24-
with:
25-
path: live
26-
ref: master
2720

2821
- name: 🐍 Set up Python 3.7
2922
uses: actions/setup-python@v4
@@ -32,108 +25,68 @@ jobs:
3225

3326
- name: 🐍 Install requirements
3427
run: |
35-
pip install -r ./src/.github/scripts/requirements.txt
28+
pip install -r ./.github/scripts/requirements.txt
3629
3730
- name: 📺 Refresh youtube thumbnails
3831
run: |
39-
cd src
4032
chmod +x .github/scripts/fetch_yt_preview
4133
.github/scripts/fetch_yt_preview
4234
4335
- name: 🕵️‍♂ Validate front matter
4436
run: |
45-
cd src
4637
python .github/scripts/validate_front_matter.py --action-output
4738
4839
- name: 🏗 Enrich front matter
4940
if: github.repository == 'OctoPrint/plugins.octoprint.org' && github.event_name != 'pull_request'
5041
run: |
51-
python ./src/.github/scripts/populate_additional_metadata.py
42+
python ./.github/scripts/populate_additional_metadata.py
5243
env:
5344
GITHUB_TOKEN: ${{ secrets.metadata_token }}
5445

5546
- name: 🏗 Enrich notices
5647
if: github.repository == 'OctoPrint/plugins.octoprint.org' && github.event_name != 'pull_request'
5748
run: |
58-
python ./src/.github/scripts/populate_additional_notices.py
49+
python ./.github/scripts/populate_additional_notices.py
5950
env:
6051
GITHUB_TOKEN: ${{ secrets.metadata_token }}
6152

6253
- name: 🏗 Enrich py2 check overlays
6354
if: github.repository == 'OctoPrint/plugins.octoprint.org' && github.event_name != 'pull_request'
6455
run: |
65-
python ./src/.github/scripts/populate_py2_overlays.py
56+
python ./.github/scripts/populate_py2_overlays.py
6657
67-
- name: 📦 Cache jekyll build bundle
68-
uses: actions/cache@v3
58+
- name: 💎 Set up Ruby 3
59+
uses: ruby/setup-ruby@v1
6960
with:
70-
path: ./bundle
71-
key: ${{ runner.os }}-jekyll-build-bundle
72-
61+
ruby-version: '3.2'
62+
bundler-cache: true
63+
7364
- name: 🔨 Build page
7465
run: |
75-
docker run \
76-
-v ${{ github.workspace }}/src:/srv/jekyll \
77-
-v ${{ github.workspace }}/bundle:/usr/local/bundle \
78-
jekyll/builder:3.8.6 /bin/bash -c "chmod 777 /srv/jekyll && jekyll build --trace --future --strict_front_matter"
79-
80-
- name: 🔄 Prepare live copy
81-
run: |
82-
rm -rf live/* || true
83-
touch live/.nojekyll
84-
cp -r src/_site/* live
85-
86-
- name: 🔎 Determine changed files
87-
id: changed
88-
run: |
89-
cd live
90-
git diff --name-only
91-
changed=($(git diff --name-only))
92-
json=`printf '%s\n' "${changed[@]}" | jq -R . | jq -c -s .`
93-
echo "files=$json" >> $GITHUB_OUTPUT
66+
bundle exec jekyll build --future --trace
9467
9568
- name: 🕵️‍♂️ Validate plugins.json
96-
if: contains( fromJSON( steps.changed.outputs.files ), 'plugins.json' )
9769
run: |
9870
docker run \
99-
-v ${{ github.workspace }}/live:/json \
71+
-v ${{ github.workspace }}/_site:/json \
10072
peterdavehello/jsonlint jsonlint -q /json/plugins.json
10173
10274
- name: 🕵️‍♂️ Validate notices.json
103-
if: contains( fromJSON( steps.changed.outputs.files ), 'notices.json' )
10475
run: |
10576
docker run \
106-
-v ${{ github.workspace }}/live:/json \
77+
-v ${{ github.workspace }}/_site:/json \
10778
peterdavehello/jsonlint jsonlint -q /json/notices.json
10879
10980
- name: 🕵️‍♂️ Validate search.json
110-
if: contains( fromJSON( steps.changed.outputs.files ), 'search.json' )
11181
run: |
11282
docker run \
113-
-v ${{ github.workspace }}/live:/json \
83+
-v ${{ github.workspace }}/_site:/json \
11484
peterdavehello/jsonlint jsonlint -q /json/search.json
11585
116-
#- name: 🕵️‍♂️ Run link check
117-
# run: |
118-
# docker run \
119-
# -v ${{ github.workspace }}/_site:/mounted-site \
120-
# mtlynch/htmlproofer /mounted-site --only-4xx --check-favicon --check-html --file-ignore '/\/mounted-site\/search\/index\.php/,/\/mounted-site\/by_(author|tag|date|name)\/index\.html/' --log-level ':debug'
121-
122-
#- name: 🕵️‍♂️ Run link check
123-
# id: lc
124-
# uses: peter-evans/link-checker@v1
125-
# with:
126-
# args: -v -r -d ./_site/ ./_site/
127-
#- name: 🕵️‍♂️ Evaluate link check
128-
# run: exit ${{ steps.lc.outputs.exit_code }}
129-
130-
- name: 🚀 Commit & deploy
131-
if: github.repository == 'OctoPrint/plugins.octoprint.org' && github.event_name != 'pull_request'
132-
uses: EndBug/add-and-commit@v9
86+
- name: ⬆ Upload pages artifact
87+
uses: actions/upload-pages-artifact@v1
13388
with:
134-
cwd: "live"
135-
message: "deploy: ${{ github.sha }}"
136-
default_author: github_actions
89+
path: ./_site
13790

13891
- name: 📧 Discord success notification
13992
if: github.repository == 'OctoPrint/plugins.octoprint.org' && github.event_name != 'pull_request'
@@ -150,3 +103,17 @@ jobs:
150103
uses: Ilshidur/action-discord@master
151104
with:
152105
args: '🚫 Page build for plugins.octoprint.org failed'
106+
107+
deploy:
108+
name: "Deploy"
109+
runs-on: ubuntu-latest
110+
needs: build
111+
112+
environment:
113+
name: github-pages
114+
url: ${{ steps.deployment.outputs.page_url }}
115+
116+
steps:
117+
- name: Deploy to GitHub Pages
118+
id: deployment
119+
uses: actions/deploy-pages@v1

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ _site
88
.DS_Store
99
.jekyll-metadata
1010
.bundle
11-
Gemfile.lock
1211
venv
1312
vendor

Gemfile

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
source 'https://rubygems.org'
2-
gem 'github-pages', ">=206", group: :jekyll_plugins
3-
gem 'jekyll-assets', group: :jekyll_plugins
2+
gem 'github-pages', group: :jekyll_plugins
43
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
5-
gem 'hitimes', '1.2.1'
6-
gem "sprockets", "~> 3.7"
4+
gem 'eventmachine', '1.2.7', git: '[email protected]:eventmachine/eventmachine', tag: 'v1.2.7' if Gem.win_platform?
5+
6+
gem 'html-proofer'
7+
gem 'jsonlint'
8+
9+
gem "webrick", "~> 1.7"

0 commit comments

Comments
 (0)