build(deps): bump the github-actions-dependencies group with 2 updates #70
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: Main - Continuous Integration | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| ci: | |
| name: Continuous Integration | |
| uses: ./.github/workflows/__shared-ci.yml | |
| secrets: inherit | |
| docs-generate-site: | |
| runs-on: ubuntu-latest | |
| needs: ci | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - run: | | |
| mkdir -p ./_site | |
| echo -e "theme: jekyll-theme-cayman" > ./_site/_config.yml | |
| to_title_case() { | |
| echo "$1" | awk '{ | |
| for (i=1; i<=NF; i++) { | |
| $i = toupper(substr($i, 1, 1)) tolower(substr($i, 2)) | |
| } | |
| }' | |
| } | |
| create_site_page() { | |
| page="$1" | |
| title="$(to_title_case "$2")" | |
| content_path="$3" | |
| echo -e "---\nlayout: default\ntitle: $title\n---\n" > "$page" | |
| echo "$(sed -r s"/(\{%[^%]+%\})/{% raw %}\1{% endraw %}/g" "$content_path")" >> "$page" | |
| } | |
| create_site_page "./_site/index.md" "Home" "./README.md" | |
| for filepath in ./docs/*.md; do | |
| filename=$(basename -- "$filepath") | |
| section="${filename%.*}" | |
| mkdir -p "./_site/$section" | |
| create_site_page "./_site/$section/index.md" "$section" "$filepath" | |
| done | |
| - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: docs-site | |
| path: ./_site | |
| docs-generate-phpdoc: | |
| runs-on: ubuntu-latest | |
| needs: ci | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: 📃 Generate PHP documentation | |
| run: docker run --rm -v $(pwd):/data phpdoc/phpdoc:3 -d ./src -t ./_site/phpdoc | |
| - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: docs-phpdoc | |
| path: ./_site | |
| docs-publish: | |
| name: Publish documentation | |
| needs: [docs-generate-site, docs-generate-phpdoc] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 | |
| with: | |
| pattern: "docs-*" | |
| path: ./ | |
| merge-multiple: true | |
| - name: ⚙️ Setup Pages | |
| uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 | |
| - name: Build with Jekyll | |
| uses: actions/jekyll-build-pages@44a6e6beabd48582f863aeeb6cb2151cc1716697 # v1.0.13 | |
| with: | |
| source: ./ | |
| destination: ./_site | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0 | |
| - name: 🚀 Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 |