Generate API docs and publish to Github Pages #124
This file contains hidden or 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: Generate API docs and publish to Github Pages | |
env: | |
BRANCHLIST: "MOODLE_401_STABLE MOODLE_403_STABLE MOODLE_404_STABLE MOODLE_405_STABLE MOODLE_500_STABLE main" | |
VERSIONLIST: "4.1 4.3 4.4 4.5 5.0 main" | |
on: | |
schedule: | |
# Publish every Sunday at 1:30am | |
- cron: '30 1 * * 0' | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-20.04 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
show-progress: '' | |
- name: Checkout Moodle | |
uses: actions/checkout@v4 | |
with: | |
repository: moodle/moodle | |
path: .moodle | |
show-progress: '' | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.moodle/.nvmrc' | |
- name: Build doxygen | |
run: docker build --tag=doxygen phpdocs/doxygen | |
- name: Generate all API Documentation | |
run: ./scripts/generate_api_docs.sh | |
- name: Copy Moodle Redirector | |
run: | | |
mkdir -p build/master | |
cp redirect.html build/master/index.html | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./build | |
cname: phpdoc.moodledev.io | |
- name: Archive build ogs | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Build logs | |
path: logs |