|
| 1 | +name: Build and Deploy Documents |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +env: |
| 6 | + LANG: "en_US.UTF-8" |
| 7 | + LC_ALL: "en_US.UTF-8" |
| 8 | + HOMEBREW_DISPLAY_INSTALL_TIMES: "ON" |
| 9 | + HOMEBREW_NO_ANALYTICS: "ON" |
| 10 | + HOMEBREW_NO_AUTO_UPDATE: "ON" |
| 11 | + HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: "ON" |
| 12 | + HOMEBREW_NO_GITHUB_API: "ON" |
| 13 | + HOMEBREW_NO_INSTALL_CLEANUP: "ON" |
| 14 | + PIP_DISABLE_PIP_VERSION_CHECK: "ON" |
| 15 | + PIP_NO_CLEAN: "ON" |
| 16 | + PIP_PREFER_BINARY: "ON" |
| 17 | + TZ: "UTC" |
| 18 | + |
| 19 | +jobs: |
| 20 | + Build-API-Docs: |
| 21 | + runs-on: macos-latest |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v2 |
| 24 | + with: |
| 25 | + fetch-depth: 0 # Full history to get tag and commit info |
| 26 | + - name: Install Dependencies |
| 27 | + run: | |
| 28 | + pip3 install --prefer-binary --no-clean --disable-pip-version-check --progress-bar off lxml fypp |
| 29 | + brew install -f --force-bottle --keep-tmp ford |
| 30 | + type -a ford |
| 31 | + ford --version |
| 32 | + gfortran --version |
| 33 | + - name: Build Docs |
| 34 | + run: | |
| 35 | + git fetch --all --tags |
| 36 | + ford -r $(git describe --always) --debug API-doc-FORD-file.md |
| 37 | + zip -vr API-docs.zip API-doc/ -x "*.DS_Store" |
| 38 | + - name: Upload Documentation |
| 39 | + uses: actions/upload-artifact@v2 |
| 40 | + with: |
| 41 | + name: FORD-API-docs |
| 42 | + path: ./API-docs.zip |
| 43 | + - name: Broken Link Check |
| 44 | + uses: technote-space/broken-link-checker-action@v1 |
| 45 | + with: |
| 46 | + TARGET: file://${{ github.workspace }}/API-doc/index.html |
| 47 | + RECURSIVE: true |
| 48 | + ASSIGNEES: ${{ github.actor }} |
| 49 | + - name: Deploy API Docs |
| 50 | + uses: peaceiris/actions-gh-pages@v3 |
| 51 | + if: github.event_name == 'push' && github.repository == 'fortran-lang/stdlib' && ( startsWith( github.ref, 'refs/tags/' ) || github.ref == 'refs/heads/master' ) |
| 52 | + with: |
| 53 | + deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} |
| 54 | + external_repository: fortran-lang/stdlib-docs |
| 55 | + publish_dir: ./API-doc |
| 56 | + publish_branch: master |
| 57 | + allow_empty_commit: true |
| 58 | + force_orphan: false |
| 59 | + commit_message: "From https://github.com/${{ github.repository }}/commit/${{ github.sha }} ${{ github.ref }}" |
0 commit comments