Skip to content

Commit f14c755

Browse files
committed
attempting to get doc deployment to work with GitHub actions
See #476
1 parent 8c9e104 commit f14c755

File tree

1 file changed

+42
-20
lines changed

1 file changed

+42
-20
lines changed

.github/workflows/CI.yml

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: CI
22

33
on: [push]
44

5-
env:
6-
CI: "ON"
7-
85
jobs:
96

107
Build:
@@ -20,6 +17,11 @@ jobs:
2017
GCC_V: ${{matrix.gcc_v}}
2118

2219
steps:
20+
21+
- name: Set vars
22+
id: vars
23+
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
24+
2325
- name: Checkout code
2426
uses: actions/checkout@v2
2527
with:
@@ -92,20 +94,40 @@ jobs:
9294
cmake ..
9395
make -j 4 check
9496
95-
# - name: Run tests
96-
# run: |
97-
# ./bin/slsqp_test
98-
# ./bin/slsqp_test_2
99-
# ./bin/slsqp_test_3
100-
# ./bin/slsqp_test_71
101-
# ./bin/slsqp_test_stopping_criterion
102-
103-
# - name: Build documentation
104-
# run: ford ./json-fortran.md
105-
106-
# - name: Deploy Documentation
107-
# if: github.ref == 'refs/heads/master'
108-
# uses: JamesIves/[email protected]
109-
# with:
110-
# branch: gh-pages # The branch the action should deploy to.
111-
# folder: doc # The folder the action should deploy.
97+
- name: Deploy Documentation for master
98+
if: github.ref == 'refs/heads/master' && $DEPLOY_DOCUMENTATION == 'yes'
99+
uses: JamesIves/[email protected]
100+
with:
101+
branch: gh-pages # The branch the action should deploy to.
102+
folder: doc # The folder the action should deploy.
103+
clean: true
104+
clean-exclude: |
105+
prev
106+
107+
- name: Rebuild documentation for tagged release
108+
env:
109+
TAGNAME: ${{ steps.vars.outputs.tag }}
110+
if: $DEPLOY_DOCUMENTATION == 'yes' && startsWith(github.ref, 'refs/tags/')
111+
run: |
112+
echo ${TAGNAME}
113+
rm -rf doc
114+
sed "2 s/^/version: ${TAGNAME}\n/" json-fortran.md > json-fortran.tagged.md
115+
ford --debug json-fortran.tagged.md
116+
117+
- name: Deploy documentation for tagged release
118+
env:
119+
TAGNAME: ${{ steps.vars.outputs.tag }}
120+
if: $DEPLOY_DOCUMENTATION == 'yes' && startsWith(github.ref, 'refs/tags/')
121+
uses: JamesIves/[email protected]
122+
with:
123+
branch: gh-pages # The branch the action should deploy to.
124+
folder: doc # The folder the action should deploy.
125+
target-folder: prev/$TAGNAME # deploy to a version-specific folder
126+
127+
- name: Upload coverage
128+
if: $CODE_COVERAGE == 'yes'
129+
run: |
130+
rm json_*.F90-*unicode.gcov || true
131+
mv json_*.F90.gcov src/
132+
mv jf_test*.[fF]90.gcov src/tests/
133+
bash <(curl -s https://codecov.io/bash) -v -X $GCOV

0 commit comments

Comments
 (0)