forked from deepjavalibrary/djl
-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (86 loc) · 3.13 KB
/
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
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
name: Docs
on:
schedule:
- cron: '0 9 * * 1'
workflow_dispatch:
inputs:
version-number:
type: string
description: What is the new version number (ex. v0.28.0) for the website? If updating dev, leave this blank.
default: master
required: false
permissions:
id-token: write
contents: read
jobs:
documentation:
if: github.repository == 'deepjavalibrary/djl'
runs-on: ubuntu-latest
steps:
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: 17
- name: Set up Python3
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install CN fonts
run: sudo apt-get update && sudo apt-get install fonts-arphic-uming
- name: Install Python Dependencies
run: pip3 install nbconvert mkdocs==1.4.3 mkdocs-exclude mknotebooks mkdocs-material jupyter Pygments Markdown mike
- name: Cache IJava Kernel
id: ijava-cache
uses: actions/cache@v4
with:
path: ~/.local/share/jupyter/kernels/java
key: ${{ runner.os }}-ijava-kernel
- name: Install IJava kernel
if: steps.ijava-cache.outputs.cache-hit != 'true'
run: |
git clone https://github.com/frankfliu/IJava.git
cd IJava/
./gradlew installKernel
- name: Checkout DJL Repo
uses: actions/checkout@v4
with:
ref: ${{ github.event.version-number }}
- name: Checkout DJL-Serving
uses: actions/checkout@v4
with:
repository: 'deepjavalibrary/djl-serving'
ref: ${{ github.event.inputs.version-number }}
path: docs/serving
- name: Checkout DJL-Demo
uses: actions/checkout@v4
with:
repository: 'deepjavalibrary/djl-demo'
ref: ${{ github.event.inputs.version-number }}
path: docs/demos
- name: Cache Jupyter Notebooks
id: jupyter-notebooks-cache
uses: actions/cache@v4
with:
path: docs/demos/jupyter
key: ${{ runner.os }}-jupyter-${{ hashFiles('docs/demos/jupyter/*') }}
- name: Run Notebooks
if: steps.jupyter-notebooks-cache.outputs.cache-hit != 'true'
working-directory: docs/demos/jupyter
env:
DJL_DISABLE_PROGRESS_BAR: true
run: bash test_notebook.sh
- name: Build docs website
run: tools/scripts/build-website.sh "${{ github.event.inputs.version-number || 'master' }}"
- name: Configure Deployment AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::425969335547:role/djl-ci-publish-role
aws-region: us-east-2
- name: Copy files to S3 with the AWS CLI
env:
DJL_VERSION: ${{ github.event.inputs.version-number || 'master' }}
run: |
aws s3 sync $DJL_VERSION s3://djl-ai/documentation/$DJL_VERSION --delete
aws s3 cp versions.json s3://djl-ai/documentation/versions.json
aws cloudfront create-invalidation --distribution-id E733IIDCG0G5U --paths "/*"