forked from CollectionBuilder/collectionbuilder-csv
-
Notifications
You must be signed in to change notification settings - Fork 1
99 lines (86 loc) · 2.84 KB
/
jekyll.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Deploy Jekyll site to Pages
on:
push:
branches: ["main", "gh-pages"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages-${{ github.ref }}"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
lang: ['en', 'de', 'es']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42
with:
ruby-version: '3.1'
bundler-cache: true
- name: Set language in config
run: |
sed -i "/^lang:/c\lang: ${{ matrix.lang }}" _config.yml
if ! grep -q "^lang:" _config.yml; then
echo "lang: ${{ matrix.lang }}" >> _config.yml
fi
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
run: bundle exec jekyll build --destination _site/${{ matrix.lang }} --baseurl "${{ steps.pages.outputs.base_path }}/${{ matrix.lang }}"
env:
JEKYLL_ENV: production
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./_site/${{ matrix.lang }}
name: site-${{ matrix.lang }}
create-index:
needs: build
runs-on: ubuntu-latest
steps:
- name: Create index.html
run: |
echo '<!DOCTYPE html>' > index.html
echo '<html lang="en">' >> index.html
echo '<head>' >> index.html
echo ' <meta charset="UTF-8">' >> index.html
echo ' <meta name="viewport" content="width=device-width, initial-scale=1.0">' >> index.html
echo ' <title>Welcome to Our Multilingual Site</title>' >> index.html
echo '</head>' >> index.html
echo '<body>' >> index.html
echo ' <h1>Welcome to Our Multilingual Site</h1>' >> index.html
echo ' <ul>' >> index.html
echo ' <li><a href="/de/">Deutsch</a></li>' >> index.html
echo ' <li><a href="/en/">English</a></li>' >> index.html
echo ' <li><a href="/es/">Español</a></li>' >> index.html
echo ' </ul>' >> index.html
echo '</body>' >> index.html
echo '</html>' >> index.html
mkdir _site
mv index.html _site/
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./_site/
name: site
deploy:
needs: create-index
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: _site
merge-multiple: true
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4