-
Notifications
You must be signed in to change notification settings - Fork 77
75 lines (62 loc) · 2.76 KB
/
build-esmf-docs.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
name: Build ESMF Docs
on:
workflow_dispatch:
push:
concurrency:
group: build-esmf-docs-${{ github.ref_name }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Dockerfiles
uses: actions/checkout@v3
with:
repository: esmf-org/esmf-containers
path: esmf-containers
ref: main
- name: Build Docker image
run: |
cd ${{ github.workspace }}/esmf-containers/build-esmf-docs/esmf
docker build . --tag esmf/build-esmf-docs --build-arg ESMF_BRANCH="${{ github.ref_name }}" --no-cache
- name: Extract artifacts
run: |
mkdir -p ${{ github.workspace }}/artifacts
CID=$(docker run -dit --name runner esmf/build-esmf-docs)
docker cp ${CID}:/artifacts/doc-artifacts.zip ${{ github.workspace }}/artifacts
docker stop ${CID}
docker rm ${CID}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: esmf-docs
path: ${{ github.workspace }}/artifacts
- name: Checkout esmf-org.github.io
uses: actions/checkout@v3
with:
repository: esmf-org/esmf-org.github.io
path: ${{github.workspace}}/esmf-org.github.io
ssh-key: ${{secrets.ESMF_WEB_DEPLOY_KEY}}
- name: Copy docs
run: |
cd ${{ github.workspace }}/esmf-org.github.io
mkdir -p docs/nightly/${{ github.ref_name }}/dev_guide
cd ${{ github.workspace }}/artifacts
unzip doc-artifacts.zip
cd ${{ github.workspace }}/artifacts/artifacts/doc-esmf
cp -rf ./* ${{ github.workspace }}/esmf-org.github.io/docs/nightly/${{ github.ref_name }}/
cd ${{ github.workspace }}/artifacts/artifacts/doc-nuopc
cp -rf NUOPC_refdoc ${{ github.workspace }}/esmf-org.github.io/docs/nightly/${{ github.ref_name }}/
cp -rf NUOPC_refdoc.pdf ${{ github.workspace }}/esmf-org.github.io/docs/nightly/${{ github.ref_name }}/
cp -rf NUOPC_howtodoc ${{ github.workspace }}/esmf-org.github.io/docs/nightly/${{ github.ref_name }}/
cp -rf NUOPC_howtodoc.pdf ${{ github.workspace }}/esmf-org.github.io/docs/nightly/${{ github.ref_name }}/
cd ${{ github.workspace }}/artifacts/artifacts/doc-dev_guide
cp -rf ./dev_guide/dev_guide/* ${{ github.workspace }}/esmf-org.github.io/docs/nightly/${{ github.ref_name }}/dev_guide/
- name: Commit and publish docs
run: |
cd ${{ github.workspace }}/esmf-org.github.io
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git diff-index --quiet HEAD || git commit --message "Publish ESMF Docs"
git push origin