Skip to content

Commit 6f3ba62

Browse files
authored
Merge pull request #522 from SpineEventEngine/staging
Release `spine.io` implemented in Hugo
2 parents 2c71b1c + 2c648c1 commit 6f3ba62

File tree

470 files changed

+9882
-29797
lines changed

Some content is hidden

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

470 files changed

+9882
-29797
lines changed

.github/workflows/check-code-embedding.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

.github/workflows/gh-pages.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- staging
8+
9+
env:
10+
HUGO_VERSION: 0.147.8
11+
GH_USER: site-commons-machine-user
12+
13+
jobs:
14+
deploy:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
token: ${{ secrets.GH_SITE_COMMONS_PAT }}
22+
submodules: true
23+
fetch-depth: 0
24+
25+
- name: Setup Hugo
26+
uses: peaceiris/actions-hugo@v3
27+
with:
28+
hugo-version: ${{ env.HUGO_VERSION }}
29+
extended: true
30+
31+
- name: Setup Node
32+
uses: actions/setup-node@v3
33+
with:
34+
node-version: '20'
35+
36+
- name: Cache dependencies
37+
uses: actions/cache@v4
38+
with:
39+
path: ~/.npm
40+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
41+
restore-keys: |
42+
${{ runner.os }}-node-
43+
44+
- name: Cache Hugo Modules
45+
uses: actions/cache@v4
46+
with:
47+
path: /tmp/hugo_cache
48+
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
49+
restore-keys: |
50+
${{ runner.os }}-hugomod-
51+
52+
- name: Prepare Environment
53+
run: git config --global url."https://${{ env.GH_USER }}:${{ secrets.GH_SITE_COMMONS_PAT }}@github.com".insteadOf "https://github.com"
54+
55+
- name: Install Dependencies
56+
working-directory: site
57+
run: npm ci
58+
59+
- name: Build Spine
60+
working-directory: site
61+
run: hugo --minify
62+
63+
- name: Deploy
64+
uses: peaceiris/actions-gh-pages@v4
65+
with:
66+
github_token: ${{ secrets.GITHUB_TOKEN }}
67+
publish_branch: gh-pages
68+
publish_dir: ./site/public

.github/workflows/proof-links.yml

Lines changed: 101 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,113 @@
11
name: Proof Links
2+
on: [pull_request, workflow_dispatch]
23

3-
on:
4-
push:
5-
branches:
6-
- master
7-
pull_request:
8-
branches:
9-
- master
4+
env:
5+
HUGO_VERSION: 0.147.8
6+
GH_USER: site-commons-machine-user
7+
LYCHEE_RELEASE: "lychee-v0.15.1-x86_64-unknown-linux-gnu.tar.gz"
8+
LYCHEE_VERSION_TAG: "v0.15.1"
109

1110
jobs:
1211
proof-links:
1312
runs-on: ubuntu-latest
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
1415
steps:
15-
- uses: actions/checkout@v3
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Hugo
20+
uses: peaceiris/actions-hugo@v3
21+
with:
22+
hugo-version: ${{ env.HUGO_VERSION }}
23+
extended: true
24+
25+
- name: Setup Node
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: '20'
29+
30+
- name: Cache dependencies
31+
uses: actions/cache@v4
32+
with:
33+
path: ~/.npm
34+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
35+
restore-keys: |
36+
${{ runner.os }}-node-
37+
38+
- name: Cache Hugo Modules
39+
uses: actions/cache@v4
40+
with:
41+
path: /tmp/hugo_cache
42+
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
43+
restore-keys: |
44+
${{ runner.os }}-hugomod-
45+
46+
- name: Prepare environment
47+
run: git config --global url."https://${{ env.GH_USER }}:${{ secrets.GH_SITE_COMMONS_PAT }}@github.com".insteadOf "https://github.com"
48+
49+
- name: Install Dependencies
50+
working-directory: site
51+
run: npm ci
52+
53+
- name: Build Spine
54+
working-directory: site
55+
run: hugo -e development
56+
57+
# Cache Lychee results to avoid hitting rate limits.
58+
- name: Cache Lychee results
59+
uses: actions/cache@v4
1660
with:
17-
submodules: 'recursive'
61+
path: .lycheecache
62+
key: cache-lychee-results
1863

19-
- name: Set up Ruby and Bundler
20-
uses: ruby/setup-ruby@v1
64+
- name: Cache Lychee executable
65+
id: cache-lychee
66+
uses: actions/cache@v4
2167
with:
22-
ruby-version: '2.7.4'
23-
24-
# Bundler version is restricted to `2.4.22`,
25-
# as we want to use Ruby `2.7.4` to match GH Pages environment.
26-
#
27-
# Any newer versions of Bundler require Ruby 3.x,
28-
# which are much newer than what's GH Pages has at the moment.
29-
#
30-
- name: Run Jekyll build
68+
path: lychee
69+
key: ${{ runner.os }}-${{ env.LYCHEE_RELEASE }}
70+
71+
# We use Lychee directly instead of a GitHub Action because it
72+
# must have access the local Hugo server, which is not visible
73+
# from the Docker-based action.
74+
- name: Download Lychee executable
75+
uses: robinraju/[email protected]
76+
if: steps.cache-lychee.outputs.cache-hit != 'true'
77+
with:
78+
repository: "lycheeverse/lychee"
79+
tag: ${{ env.LYCHEE_VERSION_TAG }}
80+
fileName: ${{ env.LYCHEE_RELEASE }}
81+
82+
- name: Extract Lychee executable
83+
if: steps.cache-lychee.outputs.cache-hit != 'true'
3184
run: |
32-
gem install bundler -v 2.4.22
33-
bundle install
34-
bundle exec jekyll build
85+
mkdir -p lychee &&
86+
tar -xf ${{ env.LYCHEE_RELEASE }} -C lychee
3587
36-
- name: Proof Links
37-
run: ./_script/proof-links
88+
# 1. In the generated HTML, some inner links will have absolute URLs and
89+
# the link checker will attempt to fetch them. That's why we need
90+
# a server. Sadly, link checkers have no settings to address this.
91+
# 2. Output redirection is necessary for nohup in GitHub Actions.
92+
# 3. Sleep makes sure the server is up before the next step.
93+
- name: Start Hugo server
94+
working-directory: site
95+
run: |
96+
nohup hugo server \
97+
--environment development \
98+
> nohup.out 2> nohup.err < /dev/null &
99+
sleep 5
100+
101+
- name: Check if the cache file exists
102+
run: |
103+
if [ -f ".lycheecache" ]; then
104+
echo "Lychee cache exists."
105+
else
106+
echo "No lychee cache file."
107+
fi
108+
109+
- name: Check links
110+
run: |
111+
./lychee/lychee --config lychee.toml --timeout 60 \
112+
--base http://localhost:1313/ \
113+
'site/public/**/*.html'

.gitignore

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
# The result of Jekyll build
2-
_site/
1+
# Hugo cache files
2+
/site/resources
3+
public
34

4-
# Intermediate directory used by `embed-code` Jekyll subcommand
5-
.fragments
5+
# Cache folder for Hugo Modules
6+
/site/_vendor
67

7-
.sass-cache
8-
.jekyll-metadata
9-
.DS_Store
8+
# Node modules
9+
node_modules
1010

11-
*/build/
11+
# Used to control concurrency between multiple Hugo instances
12+
/site/.hugo_build.lock
1213

13-
**/*.jar
14+
# Needed for navigation help inside code editors
15+
jsconfig.json
1416

15-
# Do not ignore the Gradle Wrapper at the top level and in the sub-projects that are
16-
# added as included builds. See `settings.gradle.kts` for details.
17-
!**/gradle/wrapper/*
17+
# The temporary Lychee cache obtained from local check
18+
.lycheecache
1819

1920
# IntelliJ IDEA modules and interim config files
2021
*.iml
@@ -29,6 +30,8 @@ _site/
2930
!.idea/codeStyles/
3031
!.idea/copyright/
3132

33+
.DS_Store
34+
3235
# Gradle interim configs
3336
.gradle/
3437

.gitmodules

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,3 @@
1313
[submodule "_code/examples/todo-list"]
1414
path = _code/examples/todo-list
1515
url = https://github.com/spine-examples/todo-list
16-
[submodule "_code/config"]
17-
path = config
18-
url = https://github.com/SpineEventEngine/config
19-
[submodule "_docs"]
20-
path = _docs
21-
url = https://github.com/SpineEventEngine/documentation.git

0 commit comments

Comments
 (0)