Skip to content

Commit 1c2f24f

Browse files
committed
build a site with jekyll and upload it as an artifact
1 parent 5e7e7d6 commit 1c2f24f

File tree

1 file changed

+28
-14
lines changed

1 file changed

+28
-14
lines changed

.github/workflows/build-and-deploy.yml

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,48 @@ jobs:
1919
with:
2020
vim_version: 'v9.1.0065'
2121
vim_type: 'Vim'
22+
2223
- name: Checkout
2324
uses: actions/checkout@v4
24-
with:
25-
path: work
25+
26+
#
27+
# Generate HTML from Vim documents and upload it as an artifact.
28+
#
29+
2630
- name: Generate new HTML documents
2731
run: |
28-
cd work
2932
make html
30-
cd ..
31-
mkdir target
32-
cp work/target/html/doc/*.html target
33+
3334
- name: Check commit IDs
3435
id: commitid
3536
run: |
36-
echo "vim=$(git -C work/vim rev-parse HEAD)" >> $GITHUB_OUTPUT
37-
echo "vim_faq=$(git -C work/vim_faq rev-parse HEAD)" >> $GITHUB_OUTPUT
37+
echo "vim=$(git -C vim rev-parse HEAD)" >> $GITHUB_OUTPUT
38+
echo "vim_faq=$(git -C vim_faq rev-parse HEAD)" >> $GITHUB_OUTPUT
3839
3940
- name: Upload vim generated HTML files as an artifact
4041
uses: actions/upload-artifact@v4
4142
with:
4243
name: vim-generated-html
43-
path: target
44+
path: target/html/doc
4445

45-
# TODO: Jekyllのビルド。必要なパーツをgh-pagesブランチから持ってくる必要あり
46+
#
47+
# Generate GitHub Page site and upload it as an artifact.
48+
#
4649

47-
#uses: actions/upload-pages-artifact@v3
48-
#with:
49-
# path: _site/
50-
# retantion-days: 7
50+
- name: Prepare for building GitHub Page (Jekyll)
51+
run:
52+
make jekyll-build-prepare
53+
54+
- name: Build GitHub Page site
55+
uses: actions/jekyll-build-pages@v1
56+
with:
57+
source: target/jekyll-work
58+
verbose: true
59+
60+
- name: Upload a site as an artifact
61+
uses: actions/upload-pages-artifact@v3
62+
with:
63+
path: _site/
64+
retantion-days: 7
5165

5266
# TODO: masterへのpushもしくはcron実行のときだけ、GitHub Pagesへアップロードする

0 commit comments

Comments
 (0)