This repository was archived by the owner on Jan 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 522
98 lines (83 loc) · 3.94 KB
/
buildwebsite.yml
File metadata and controls
98 lines (83 loc) · 3.94 KB
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
name: continuous build - docs
on: [push, pull_request_target]
defaults:
run:
shell: bash
jobs:
website-build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Install Linux dependencies
run: |
sudo apt-get install libopenblas-dev pandoc
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.7
architecture: x64
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Install Other Dependencies
run: |
python -m pip install --quiet --upgrade pip
python -m pip install --upgrade cython
python -m pip install --pre "mxnet>=2.0.0b20201206" -f https://dist.mxnet.io/python
python -m pip install setuptools ipython sphinx>=1.5.5 sphinx-gallery nbsphinx sphinx_rtd_theme mxtheme sphinx-autodoc-typehints matplotlib Image recommonmark
- name: Checkout repository(For push)
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v2
- name: Compile Notebooks(For push)
if: ${{ github.event_name == 'push' }}
run: |
python -m pip install --quiet -e .[extras]
./tools/batch/batch_states/compile_notebooks.sh \
"push" "${{ github.run_number }}" \
"${{ github.repository }}" "${{ github.ref }}"
exit $?
- name: Checkout Pull Request Repository(For pull request)
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }}
uses: actions/checkout@v2
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Compile Notebooks(For pull request)
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }}
run: |
python -m pip install --quiet -e .[extras]
./tools/batch/batch_states/compile_notebooks.sh \
"#PR-${{ github.event.number }}" "${{ github.run_number }}" \
"${{ github.event.pull_request.head.repo.full_name }}" "${{ github.event.pull_request.head.ref }}"
exit $?
- name: Build Website local
if: ${{ failure() || success() }}
run: |
make docs_local
- name: Copy docs to AWS S3(For push)
if: ${{ (failure() || success()) && github.event_name == 'push' }}
run: |
echo "Uploading docs to s3://gluon-nlp/${GITHUB_REF##*/}/"
aws s3 sync --delete ./docs/_build/html/ s3://gluon-nlp/${GITHUB_REF##*/}/ --acl public-read
- name: Copy docs to AWS S3(For pull request)
if: ${{ (failure() || success()) && (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') }}
run: |
echo "Uploading docs to s3://gluon-nlp-staging/PR${{ github.event.number }}/${{ github.event.pull_request.head.ref }}/"
aws s3 sync --delete ./docs/_build/html/ s3://gluon-nlp-staging/PR${{ github.event.number }}/${{ github.event.pull_request.head.ref }}/ --acl public-read
- name: Upload Artifacts
if: ${{ failure() || success() }}
uses: actions/upload-artifact@v2
with:
name: Notebook_Logs
path: ./*.stdout.log
- name: Create comment
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }}
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.number }}
body: |
The documentation website for preview: http://gluon-nlp-staging.s3-accelerate.dualstack.amazonaws.com/PR${{ github.event.number }}/${{ github.event.pull_request.head.ref }}/index.html