docs(rock5/rock5itx): add component descriptions under physical image #3298
Workflow file for this run
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: Deploy | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| merge_group: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| test: [""] | |
| stage: ["commit", "push"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Agent doc lint (changed files) | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| FROM_REF="" | |
| TO_REF="" | |
| if [ "${{ github.event_name }}" == "push" ] | |
| then | |
| if [ "${{ github.event.created }}" != "true" ] | |
| then | |
| FROM_REF="${{ github.event.before }}" | |
| TO_REF="${{ github.event.after }}" | |
| fi | |
| elif [ "${{ github.event_name }}" == "pull_request" ] | |
| then | |
| FROM_REF="${{ github.event.pull_request.base.sha }}" | |
| TO_REF="${{ github.event.pull_request.head.sha }}" | |
| elif [ "${{ github.event_name }}" == "merge_group" ] | |
| then | |
| FROM_REF="${{ github.event.merge_group.base_sha }}" | |
| TO_REF="${{ github.event.merge_group.head_sha }}" | |
| fi | |
| if [ -z "$FROM_REF" ] || [ -z "$TO_REF" ] | |
| then | |
| echo "No diff range available for this event, skipping agent-doc-lint." | |
| exit 0 | |
| fi | |
| mapfile -t files < <(git diff --name-only "$FROM_REF" "$TO_REF" | grep -E '^(docs|i18n/en/docusaurus-plugin-content-docs/current)/.*\.(md|mdx)$' || true) | |
| if [ "${#files[@]}" -eq 0 ] | |
| then | |
| echo "No markdown docs changed, skipping agent-doc-lint." | |
| exit 0 | |
| fi | |
| echo "Running agent-doc-lint on ${#files[@]} file(s)." | |
| ./scripts/agent-doc-lint.sh "${files[@]}" | |
| - name: Agent doc drift guard | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| ./scripts/agent-doc-drift-guard.sh | |
| - name: Agent doc translation guard | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| ./scripts/agent-doc-translation-guard.sh | |
| - name: pre-commit checks | |
| shell: bash | |
| run: | | |
| set -o pipefail | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends webp pipx | |
| pipx ensurepath | |
| pipx install pre-commit | |
| CI_FAIL=false | |
| EXTRA_ARGS=("--all-files") | |
| if [ "${{ github.event_name }}" == "push" ] | |
| then | |
| if [ "${{ github.event.created }}" != "true" ] | |
| then | |
| git fetch origin ${{ github.event.before }}:old_head | |
| FROM_REF="${{ github.event.before }}" | |
| TO_REF="${{ github.event.after }}" | |
| EXTRA_ARGS=("--from-ref" "$FROM_REF" "--to-ref" "$TO_REF") | |
| fi | |
| elif [ "${{ github.event_name }}" == "pull_request" ] | |
| then | |
| FROM_REF="${{ github.event.pull_request.base.sha }}" | |
| TO_REF="${{ github.event.pull_request.head.sha }}" | |
| EXTRA_ARGS=("--from-ref" "$FROM_REF" "--to-ref" "$TO_REF") | |
| elif [ "${{ github.event_name }}" == "merge_group" ] | |
| then | |
| git fetch origin ${{ github.event.merge_group.base_sha }}:old_head | |
| FROM_REF="${{ github.event.merge_group.base_sha }}" | |
| TO_REF="${{ github.event.merge_group.head_sha }}" | |
| EXTRA_ARGS=("--from-ref" "$FROM_REF" "--to-ref" "$TO_REF") | |
| fi | |
| EXTRA_ARGS+=("--hook-stage" "${{ matrix.stage }}" "${{ matrix.test }}") | |
| if ! pre-commit run --show-diff-on-failure "${EXTRA_ARGS[@]}" 2>&1 | tee /tmp/ci_result.log | |
| then | |
| CI_FAIL=true | |
| fi | |
| if $CI_FAIL | |
| then | |
| echo '' | |
| echo '=== Issue detected! ===' | |
| echo 'Suggest changes are listed above.' | |
| echo 'Please install pre-commit and run `pre-commit run --all-files` to fix it.' | |
| echo 'Strongly recommended to run `pre-commit install` to catch issues before pushing.' | |
| echo 'You can learn more about pre-commit from https://pre-commit.com/' | |
| exit 1 | |
| fi | |
| test-optional: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| test: ["check-external-links", "gitown"] | |
| stage: ["manual"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: pre-commit check-external-links | |
| shell: bash | |
| run: | | |
| set -o pipefail | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends webp pipx | |
| pipx ensurepath | |
| pipx install pre-commit | |
| CI_FAIL=false | |
| EXTRA_ARGS=("--all-files") | |
| if [ "${{ github.event_name }}" == "push" ] | |
| then | |
| if [ "${{ github.event.created }}" != "true" ] | |
| then | |
| git fetch origin ${{ github.event.before }}:old_head | |
| FROM_REF="${{ github.event.before }}" | |
| TO_REF="${{ github.event.after }}" | |
| EXTRA_ARGS=("--from-ref" "$FROM_REF" "--to-ref" "$TO_REF") | |
| fi | |
| elif [ "${{ github.event_name }}" == "pull_request" ] | |
| then | |
| FROM_REF="${{ github.event.pull_request.base.sha }}" | |
| TO_REF="${{ github.event.pull_request.head.sha }}" | |
| EXTRA_ARGS=("--from-ref" "$FROM_REF" "--to-ref" "$TO_REF") | |
| elif [ "${{ github.event_name }}" == "merge_group" ] | |
| then | |
| git fetch origin ${{ github.event.merge_group.base_sha }}:old_head | |
| FROM_REF="${{ github.event.merge_group.base_sha }}" | |
| TO_REF="${{ github.event.merge_group.head_sha }}" | |
| EXTRA_ARGS=("--from-ref" "$FROM_REF" "--to-ref" "$TO_REF") | |
| fi | |
| EXTRA_ARGS+=("--hook-stage" "${{ matrix.stage }}" "${{ matrix.test }}") | |
| if ! pre-commit run --show-diff-on-failure "${EXTRA_ARGS[@]}" 2>&1 | tee /tmp/ci_result.log | |
| then | |
| CI_FAIL=true | |
| fi | |
| if $CI_FAIL | |
| then | |
| echo '' | |
| echo '=== Issue detected! ===' | |
| echo 'Suggest changes are listed above.' | |
| echo 'Please install pre-commit and run `pre-commit run --all-files` to fix it.' | |
| echo 'Strongly recommended to run `pre-commit install` to catch issues before pushing.' | |
| echo 'You can learn more about pre-commit from https://pre-commit.com/' | |
| exit 1 | |
| fi | |
| build: | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'pull_request' | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout template | |
| uses: actions/checkout@v6 | |
| with: | |
| token: "${{ secrets.PRIVATE_REPO_TOKEN }}" | |
| repository: "radxa-docs/docs-template" | |
| - name: Checkout contents | |
| uses: actions/checkout@v6 | |
| with: | |
| path: "contents" | |
| - name: Install dependencies | |
| run: yarn install | |
| - name: Fetch Baidu Tongji data | |
| run: node ./contents/.github/scripts/baidu-tongji.js | |
| env: | |
| BAIDU_TONGJI_ACCESS_TOKEN: ${{ secrets.BAIDU_TONGJI_ACCESS_TOKEN }} | |
| BAIDU_TONGJI_REFRESH_TOKEN: ${{ secrets.BAIDU_TONGJI_REFRESH_TOKEN }} | |
| BAIDU_TONGJI_CLIENT_ID: ${{ secrets.BAIDU_TONGJI_CLIENT_ID }} | |
| BAIDU_TONGJI_CLIENT_SECRET: ${{ secrets.BAIDU_TONGJI_CLIENT_SECRET }} | |
| - name: Generate latest updates JSON | |
| run: node ./contents/.github/scripts/latest-updates.js | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_REPOSITORY: ${{ github.repository }} | |
| - name: Build | |
| run: | | |
| export NODE_OPTIONS="--max-old-space-size=8192" | |
| yarn build | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| # Upload entire repository | |
| path: "./build" | |
| deploy: | |
| needs: build | |
| if: github.event_name != 'pull_request' && github.event_name != 'merge_group' && github.ref_name == 'main' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| pages: write | |
| steps: | |
| - name: Setup Pages | |
| id: setup-pages | |
| uses: actions/configure-pages@v6 | |
| continue-on-error: true | |
| - name: Deploy to GitHub Pages | |
| uses: actions/deploy-pages@v5 | |
| if: steps.setup-pages.outcome == 'success' |