Skip to content

Docs

Docs #175

Workflow file for this run

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:
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 || 'master' }}
path: docs/serving
- name: Checkout DJL-Demo
uses: actions/checkout@v4
with:
repository: 'deepjavalibrary/djl-demo'
ref: ${{ github.event.inputs.version-number || 'master' }}
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: Configure AWS Test Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
audience: sts.amazonaws.com
aws-region: us-east-1
role-to-assume: arn:aws:iam::185921645874:role/UpdateWebsite
role-session-name: UpdateWebsite
- name: Build docs website
run: tools/scripts/build-website.sh "${{ github.event.inputs.version-number || 'master' }}"
- name: Copy files to S3 with the AWS CLI
env:
DJL_VERSION: ${{ github.event.inputs.pt_version || 'master' }}
#DJL_VERSION: 'cache'
run: |
aws s3 sync $DJL_VERSION s3://updated-documentation-website/website/$DJL_VERSION --delete
aws s3 cp versions.json s3://updated-documentation-website/website/versions.json