feat: rework website theme #437
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: Verify Markdown | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - website/** | |
| paths: | |
| - '**/*.md' | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| markdown-lint: | |
| runs-on: ubuntu-latest | |
| name: Lint Markdown | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4 | |
| - uses: DavidAnson/markdownlint-cli2-action@992badcdf24e3b8eb7e87ff9287fe931bcb00c6e # v20 | |
| with: | |
| globs: | | |
| **/*.md | |
| !content/docs/reference/ocm-cli | |
| !content/docs/reference/ocm-controller | |
| config: .github/config/.markdownlint-cli2.yaml | |
| spellcheck: | |
| name: Spellcheck | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4 | |
| - name: Spellcheck | |
| uses: rojopolis/spellcheck-github-actions@35a02bae020e6999c5c37fabaf447f2eb8822ca7 # v0 | |
| with: | |
| config_path: .github/config/spellcheck.yml | |
| task_name: Markdown | |
| verify-links: | |
| name: Verify links | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4 | |
| - name: Wait for Netlify Deploy Preview | |
| id: wait_for_preview | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| set -euo pipefail | |
| echo "Waiting up to 10 minutes for Netlify deploy preview..." | |
| export REPO="${{ github.repository }}" | |
| export SHA="${{ github.event.pull_request.head.sha }}" | |
| timeout 600 bash -c ' | |
| while true; do | |
| SUITE_JSON=$(gh api repos/"$REPO"/commits/"$SHA"/check-suites 2>/dev/null) | |
| if [ -z "$SUITE_JSON" ] || ! echo "$SUITE_JSON" | jq .check_suites > /dev/null 2>&1; then | |
| echo "[ERROR] gh api or jq failed, retrying..." | |
| sleep 5 | |
| continue | |
| fi | |
| NETLIFY_SUITE=$(echo "$SUITE_JSON" | jq "[ .check_suites[] | select(.app.slug == \"netlify\") ]") | |
| NETLIFY_SUITE_LEN=$(echo "$NETLIFY_SUITE" | jq length) | |
| if ! [[ "$NETLIFY_SUITE_LEN" =~ ^[0-9]+$ ]] || [ "$NETLIFY_SUITE_LEN" -eq 0 ]; then | |
| echo "No Netlify suite found. Waiting..." | |
| sleep 5 | |
| continue | |
| fi | |
| SUITE_ID=$(echo "$NETLIFY_SUITE" | jq -r ".[0].id") | |
| STATUS=$(echo "$NETLIFY_SUITE" | jq -r ".[0].status") | |
| CONCLUSION=$(echo "$NETLIFY_SUITE" | jq -r ".[0].conclusion") | |
| echo "Netlify suite status: $STATUS, conclusion: $CONCLUSION" | |
| if [ "$STATUS" = "completed" ]; then | |
| if [[ "$CONCLUSION" = "success" || "$CONCLUSION" = "neutral" ]]; then | |
| STATUS_JSON=$(gh api repos/"$REPO"/commits/"$SHA"/status 2>/dev/null) | |
| STATUS_CODE=$? | |
| if [ $STATUS_CODE -ne 0 ]; then | |
| echo "[ERROR] gh api status call failed." | |
| exit 1 | |
| fi | |
| PREVIEW_STATUS=$(echo "$STATUS_JSON" | jq ".statuses[] | select(.context==\"netlify/open-component-model/deploy-preview\")") | |
| PREVIEW_URL=$(echo "$PREVIEW_STATUS" | jq -r ".target_url") | |
| echo "✅ Deploy Preview ready: $PREVIEW_URL" | |
| echo "preview_url=$PREVIEW_URL" >> $GITHUB_OUTPUT | |
| exit 0 | |
| else | |
| echo "❌ Deploy failed: $CONCLUSION" | |
| exit 1 | |
| fi | |
| fi | |
| sleep 15 | |
| done | |
| ' | |
| if [ $? -eq 124 ]; then | |
| echo "❌ Timeout after 10 minutes" | |
| exit 1 | |
| fi | |
| - name: Generate linkspector config | |
| # The linkspector config needs to be generated dynamically as | |
| # the action does not support passing the base URL as an environment variable. | |
| run: | | |
| cat > .github/config/linkspector.yaml << EOF | |
| dirs: | |
| - ./content | |
| baseUrl: "$BASEURL" | |
| ignorePatterns: | |
| - pattern: '/images/.*' | |
| EOF | |
| echo "Generated config:" | |
| cat .github/config/linkspector.yaml | |
| env: | |
| BASEURL: ${{ steps.wait_for_preview.outputs.preview_url }} | |
| - name: Run linkspector | |
| uses: umbrelladocs/action-linkspector@874d01cae9fd488e3077b08952093235bd626977 # v1 | |
| with: | |
| github_token: ${{ secrets.github_token }} | |
| reporter: github-pr-check | |
| fail_level: any | |
| config_file: .github/config/linkspector.yaml | |
| show_stats: true | |
| env: | |
| BASEURL: ${{ steps.wait_for_preview.outputs.preview_url }} |