my_update_docs #15
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: Update ArkDoc documentation | |
| on: | |
| schedule: | |
| - cron: "0 0 1 * *" | |
| workflow_dispatch: | |
| repository_dispatch: | |
| types: | |
| - my_update_docs | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
| concurrency: | |
| group: "update-docs" | |
| cancel-in-progress: false | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout website | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Checkout ArkDoc | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: ArkScript-lang/ArkDoc | |
| path: './arkdoc' | |
| ref: 'master' | |
| - name: Checkout std | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: ArkScript-lang/std | |
| path: './std-latest' | |
| - name: Checkout ArkScript | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: ArkScript-lang/Ark | |
| path: './ark-latest' | |
| ref: 'dev' | |
| # so that we can fetch tags | |
| fetch-depth: 0 | |
| - name: Checkout modules | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: ArkScript-lang/modules | |
| path: './ark-modules' | |
| - uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.9' | |
| - name: Pip install | |
| run: | | |
| cd arkdoc/ | |
| pip install -r requirements.txt | |
| - name: Generate documentation | |
| shell: bash | |
| run: | | |
| ark_version=$(cd ark-latest; git describe --tags | cut -f1 -d-) | |
| echo "New ArkScript tag: ${ark_version}" | |
| # run arkdoc | |
| cd arkdoc | |
| export ARKDOC_LOGLEVEL=DEBUG | |
| python -m arkdoc $ark_version ../ark-latest/src/arkreactor/Builtins/ ../std-latest/ --markdown out || exit 1 | |
| cd .. | |
| cp arkdoc/out/$ark_version/* ./content/docs/std/ | |
| - name: Update modules docs | |
| shell: bash | |
| run: | | |
| for f in ark-modules/{draft,src}/*/documentation/*.md; do | |
| module_name=$(basename $(dirname $(dirname $f))) | |
| if [[ "$(basename f)" == "README.md" ]]; then | |
| mv $f "content/docs/std/module_${module_name}.md" | |
| fi | |
| done | |
| - name: Commit | |
| uses: github-actions-x/commit@v2.9 | |
| with: | |
| github-token: ${{ secrets.CI_GITHUB_TOKEN }} | |
| push-branch: 'master' | |
| commit-message: 'chore: update stdlib documentation' | |
| force-add: 'true' | |
| files: ./content/docs/std/ | |
| name: Lex Plt through GitHub Action | |
| email: lexplt.dev@gmail.com | |