Revert "Remove unnecessary extract" #22
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 Wiki | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: ["main"] | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: update-wiki-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| wiki: | |
| name: Update Wiki | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ github.token }} | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" | |
| - name: Cache Composer dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-composer- | |
| - name: Install dependencies | |
| uses: php-actions/composer@v6 | |
| env: | |
| COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ github.token }}"} }' | |
| with: | |
| php_version: '8.3' | |
| - name: Create Docs Markdown | |
| uses: php-actions/composer@v6 | |
| with: | |
| php_version: '8.3' | |
| command: 'dev-tools docs' | |
| - name: Prepare wiki submodule branch | |
| id: wiki_branch | |
| working-directory: docs/wiki | |
| run: | | |
| git fetch origin | |
| wiki_branch="$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')" | |
| if [ -z "$wiki_branch" ]; then | |
| wiki_branch="$(git branch -r | sed 's/^[[:space:]]*origin\///' | grep -v '^HEAD$' | head -n 1)" | |
| fi | |
| if [ -z "$wiki_branch" ]; then | |
| echo "Could not determine wiki branch" >&2 | |
| exit 1 | |
| fi | |
| echo "branch=$wiki_branch" >> "$GITHUB_OUTPUT" | |
| git checkout -B "$wiki_branch" "origin/$wiki_branch" | |
| - name: Commit & push wiki submodule | |
| id: wiki_commit | |
| uses: EndBug/add-and-commit@v10 | |
| with: | |
| cwd: docs/wiki | |
| add: . | |
| message: "Update wiki docs" | |
| default_author: github_actions | |
| pull: "--rebase" | |
| push: true | |
| - name: Commit parent repo submodule pointer | |
| if: steps.wiki_commit.outputs.committed == 'true' | |
| id: parent_commit | |
| uses: EndBug/add-and-commit@v10 | |
| with: | |
| add: docs/wiki | |
| message: "Update wiki submodule pointer" | |
| default_author: github_actions | |
| pull: "--rebase" | |
| push: true |