-
Notifications
You must be signed in to change notification settings - Fork 24
185 lines (184 loc) · 6.22 KB
/
github_actions.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: NWChem-wiki mirroring and website update
on:
push:
release:
schedule:
- cron: '0 0 * * *'
repository_dispatch:
types: [backend_automation]
workflow_dispatch:
jobs:
mirror_dotwiki2repo:
if: |
github.event_name == 'schedule' ||
(!contains(github.event.head_commit.message, 'ci skip'))
runs-on: [ubuntu-22.04]
steps:
- name: Checkout nwchem-wiki
uses: actions/checkout@v3
with:
repository: nwchemgit/nwchem-wiki
persist-credentials: false
fetch-depth: 0
- name: fetch and merge
run: |
git config user.name "nwchemgit"
git config user.email "[email protected]"
git config pull.rebase false
git remote add upstream https://github.com/nwchemgit/nwchem.wiki > /dev/null 2>&1
git fetch origin
git fetch upstream
git merge upstream/master --no-edit
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
mirror_repo2dotwiki:
if: |
github.event_name == 'schedule' ||
(!contains(github.event.head_commit.message, 'ci skip'))
needs: mirror_dotwiki2repo
runs-on: [ubuntu-22.04]
steps:
- name: Checkout nwchem.wiki
uses: actions/checkout@v3
with:
repository: nwchemgit/nwchem.wiki
persist-credentials: false
fetch-depth: 0
- name: fetch and merge
run: |
git config user.name "nwchemgit"
git config user.email "[email protected]"
git config pull.rebase false
git remote add upstream https://github.com/nwchemgit/nwchem-wiki > /dev/null 2>&1
git fetch origin
git fetch upstream
git merge upstream/master --no-edit
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.REPOSITORY_TOKEN }}
branch: ${{ github.ref }}
repository: nwchemgit/nwchem.wiki
NWChem_website_update:
if: |
github.event_name == 'schedule' ||
(!contains(github.event.head_commit.message, 'ci skip'))
needs: mirror_repo2dotwiki
runs-on: [ubuntu-22.04]
steps:
- name: checkout wiki
uses: actions/checkout@v3
with:
repository: nwchemgit/nwchem-wiki
persist-credentials: false
fetch-depth: 1
- name: move wiki source under docs
shell: bash
run: |
pwd
ls -l
mkdir -p mkdocs/docs
rsync -a --exclude=.git --exclude=mkdocs * mkdocs/docs/.
ls -lrt mkdocs/docs|tail -4
- name: check mkdocs directory
shell: bash
run: |
pwd
ls -lart
ls -lart mkdocs
ls -lart mkdocs/docs
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: install mkdocs and plugins
shell: bash
working-directory: mkdocs
run: |
pwd
bash ./install_mkdocs.sh
mkdocs -V || true
- name: checkout archived forum
shell: bash
working-directory: mkdocs
run: |
echo " GITHUB_REF_NAME is $GITHUB_REF_NAME"
curl -LJ \
https://github.com/nwchemgit/archivedforum/tarball/"$GITHUB_REF_NAME"\
| tar -xz --wildcards \
nwchemgit-archivedforum-*/Special_AWCforum/*
mv nwchemgit-archivedforum-* archivedforum
pwd
- name: move archiveforum source
shell: bash
working-directory: mkdocs/docs/
run: |
echo ' ### ls on mkdocs ###'
ls -lart ../
echo ' ### ls on mkdocs/archivedforum ###'
ls -lrt ../archivedforum
mv ../archivedforum/Special_AWCforum .
- name: build website
shell: bash
working-directory: mkdocs
run: |
MKDOCS_SERVE=B bash ./build_website.sh
ls -lart || true
ls -lart site/index.html || true
echo github.event_name ${{ github.event_name }}
- name: write pdf
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
shell: bash
working-directory: mkdocs
run: |
cd site
tries=1 ; until [ "$tries" -ge 5 ] ; do
sudo apt-get -y install libjpeg-turbo8 libpng16-16 fontconfig \
libxext6 libfreetype6 libxrender1 libx11-6 xfonts-75dpi libexpat1 \
libfontenc1 x11-common xfonts-encodings xfonts-base curl && break
tries=$((tries+1)) ; echo attempt no. $tries ; sleep 9 ; done
curl -LJO \
https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb
sudo apt-get -y install libssl3
sudo dpkg -i wkhtmltox_*.deb
rm -f wkhtmltox_*.deb
wkhtmltopdf --javascript-delay 45000 --enable-local-file-access \
print_page.html nwchemusermanual.pdf
ls -l nwchemusermanual.pdf
- name: checkout website
shell: bash
working-directory: mkdocs
run: |
git clone -b $GITHUB_REF_NAME --depth 1 \
https://github.com/nwchemgit/nwchemgit.github.io
- name: update nwchemgit.github.io with new content
shell: bash
working-directory: mkdocs
run: |
time -p rsync -W --exclude=.git -a site/* nwchemgit.github.io/.
ls -lart site/index.html || true
ls -lart nwchemgit.github.io/index.html || true
cd nwchemgit.github.io
time -p git log -1
- name: Commit changes
shell: bash
working-directory: mkdocs/nwchemgit.github.io
run: |
pwd
ls -lrt ../
bash ../commit_changes.sh
- name: Push changes
uses: ad-m/github-push-action@master
with:
directory: mkdocs/nwchemgit.github.io
github_token: ${{ secrets.REPOSITORY_TOKEN }}
branch: ${{ github.ref }}
repository: nwchemgit/nwchemgit.github.io
- name: Check commit result
shell: bash
working-directory: mkdocs/nwchemgit.github.io
run: |
git log -10