This repository has been archived by the owner on Jan 15, 2024. It is now read-only.
DOC: fix documents url #1059
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Checkout repository | |
uses: actions/checkout@v2 | |
- 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 --quiet boto3 | |
- name: Build Website (For push) | |
if: ${{ (failure() || success()) && github.event_name == 'push' }} | |
run: | | |
python ./tools/batch/submit-job.py --region us-east-1 \ | |
--job-type g4dn.4x \ | |
--name GluonNLP-Website-${{ github.ref }} \ | |
--remote https://github.com/${{ github.repository }} \ | |
--source-ref ${{ github.ref }} \ | |
--work-dir . \ | |
--saved-output docs/tutorials \ | |
--save-path tutorials \ | |
--command "python -m pip install --quiet -e .[web] && \ | |
apt-get install -y pandoc zip && \ | |
./tools/batch/batch_states/compile_notebooks.sh \ | |
'push' ${GITHUB_REF##*/}" \ | |
--wait | tee build_website.log | |
- name: Build Website (For pull request) | |
if: ${{ (failure() || success()) && (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') }} | |
run: | | |
python ./tools/batch/submit-job.py --region us-east-1 \ | |
--job-type g4dn.4x \ | |
--name GluonNLP-Website-PR#${{ github.event.number }} \ | |
--remote https://github.com/${{ github.event.pull_request.head.repo.full_name }} \ | |
--source-ref ${{ github.event.pull_request.head.sha }} \ | |
--work-dir . \ | |
--saved-output docs/tutorials \ | |
--save-path tutorials \ | |
--command "python -m pip install --quiet -e .[web] && \ | |
apt-get install -y pandoc zip && \ | |
./tools/batch/batch_states/compile_notebooks.sh \ | |
${{ github.event.number }} ${{ github.event.pull_request.head.sha }}" \ | |
--wait | tee build_website.log | |
- name: Wait for job and copy logs from AWS s3 | |
if: ${{ failure() || success() }} | |
run: | | |
head -100 build_website.log | grep -oP -m 1 'jobId: \K(.*)' > jobid.log | |
echo "Job ID is" | |
cat jobid.log | |
cat jobid.log | xargs -i python ./tools/batch/wait-job.py --job-id {} | |
echo "Copy Log file" | |
cat jobid.log | xargs -i aws s3api wait object-exists --bucket gluon-nlp-dev --key batch/{}/tutorials/index.rst | |
cat jobid.log | xargs -i aws s3 cp s3://gluon-nlp-dev/batch/{}/tutorials tutorials --recursive | |
- name: Upload Notebook Compile Logs | |
if: ${{ failure() || success() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Notebook_Logs | |
path: ./tutorials/**/*.stdout.log | |
- name: Upload Website Build Log | |
if: ${{ failure() || success() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Website_Log | |
path: ./build_website.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.sha }}/index.html |