-
Notifications
You must be signed in to change notification settings - Fork 64
132 lines (123 loc) · 3.91 KB
/
generate.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Generate vim help
on:
push:
branches:
- master
concurrency: vimdoc-ja-deploy
# global concurrency limit access to vim-jp/vimdoc-ja per workflow
jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: Initialization
run: |
sudo apt-get update
# libfuse2 and LD_PRELOAD are needed for appimage.
sudo apt-get -y install libfuse2
echo "LD_PRELOAD=/lib/x86_64-linux-gnu/libgmodule-2.0.so" >> $GITHUB_ENV
- name: checkout master
uses: actions/checkout@v4
with:
path: work
- name: Checkout vimdoc-ja
uses: actions/checkout@v4
with:
path: target
repository: 'vim-jp/vimdoc-ja'
ssh-key: ${{ secrets.VIMDOC_JA_SSH_KEY }}
- name: Setup Vim
uses: thinca/action-setup-vim@v2
with:
vim_version: 'v9.1.0065'
vim_type: 'Vim'
- name: Generate new document
run: |
cd work
# Create tags
vim -eu tools/maketags.vim
cd ..
- name: Check commit ID
id: commitid
run: |
echo "id=$(git -C work rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Update target
run: |
cd target
# update latest
git pull --rebase
cd ..
- name: Install new document
run: |
# install
rsync -rlptD --delete-after work/doc/ target/doc
rsync -rlptD --delete-after work/syntax/ target/syntax
rsync -rlptD --delete-after work/README-dist.md target/README.md
- name: Commit updated master branch
uses: EndBug/add-and-commit@v9
with:
cwd: './target'
default_author: github_actions
message: |-
Generated by GitHub workflow ${{ github.run_id }}
https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
Used commit:
https://github.com/${{ github.repository }}/commit/${{ steps.commitid.outputs.id }}
deploy:
runs-on: ubuntu-latest
needs: generate
# "deploy" update vimdoc-ja/gh-pages branch
# work after "generate" to updated vimdoc-ja/master branch
# parallel work conflict vimdoc-ja repo status
steps:
- name: Initialization
run: |
sudo apt-get update
# libfuse2 and LD_PRELOAD are needed for appimage.
sudo apt-get -y install libfuse2
echo "LD_PRELOAD=/lib/x86_64-linux-gnu/libgmodule-2.0.so" >> $GITHUB_ENV
- name: checkout master
uses: actions/checkout@v4
with:
path: work
- name: Checkout vimdoc-ja
uses: actions/checkout@v4
with:
path: target
repository: 'vim-jp/vimdoc-ja'
ssh-key: ${{ secrets.VIMDOC_JA_SSH_KEY }}
ref: gh-pages
- name: Setup Vim
uses: thinca/action-setup-vim@v2
with:
vim_version: 'v9.1.0065'
vim_type: 'Vim'
- name: Generate new document
run: |
cd work
# Create html documents
make html
cd ..
- name: Check commit ID
id: commitid
run: |
echo "id=$(git -C work rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Update target
run: |
cd target
# update latest
git pull --rebase
cd ..
- name: Install new document
run: |
# install
cp work/target/html/doc/*.html target
- name: Commit updated master branch
uses: EndBug/add-and-commit@v9
with:
cwd: './target'
default_author: github_actions
message: |-
Generated by GitHub workflow ${{ github.run_id }}
https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
Used commit:
https://github.com/${{ github.repository }}/commit/${{ steps.commitid.outputs.id }}