chore: add .claude to .gitignore #714
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 Live | |
| on: | |
| push: | |
| branches: [main] | |
| permissions: {} | |
| concurrency: | |
| group: deploy-live | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| if: github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' | |
| name: Build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Setup node | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | |
| with: | |
| node-version: "22" | |
| cache: "yarn" | |
| - name: Install dependencies | |
| run: yarn --frozen-lockfile --prefer-offline --ignore-scripts | |
| - name: Build packages | |
| run: yarn build-packages | |
| - name: Build site | |
| run: yarn build-demo && zip -r build.zip demo/build | |
| - name: Check for tampered config | |
| run: git diff --exit-code -- firebase.json .firebaserc package.json yarn.lock 'demo/docusaurus.config.*' 'scripts/**' '.github/**' | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: build | |
| path: build.zip | |
| deploy: | |
| if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }} | |
| name: Deploy | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: production | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Setup node | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | |
| with: | |
| node-version: "22" | |
| cache: "yarn" | |
| - name: Authenticate to Google Cloud | |
| id: auth | |
| uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3.0.0 | |
| with: | |
| workload_identity_provider: ${{ secrets.WIF_PROVIDER }} | |
| service_account: ${{ secrets.WIF_SERVICE_ACCOUNT }} | |
| - name: Read GCP credentials | |
| id: creds | |
| run: | | |
| creds=$(cat "${{ steps.auth.outputs.credentials_file_path }}") | |
| echo "::add-mask::$creds" | |
| echo "sa_key=$creds" >> "$GITHUB_OUTPUT" | |
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: build | |
| - name: Unzip build artifact | |
| run: unzip -n build.zip 'demo/build/*' | |
| - name: Deploy to Firebase | |
| id: deploy_live | |
| uses: FirebaseExtended/action-hosting-deploy@e2eda2e106cfa35cdbcf4ac9ddaf6c4756df2c8c # v0.10.0 | |
| with: | |
| repoToken: "${{ secrets.GITHUB_TOKEN }}" | |
| firebaseServiceAccount: "${{ steps.creds.outputs.sa_key }}" | |
| projectId: pandev | |
| channelId: live | |
| target: docusaurus-openapi.tryingpan.dev | |
| env: | |
| FIREBASE_CLI_PREVIEWS: hostingchannels | |
| cache_prod_screenshots: | |
| name: Cache Prod Screenshots | |
| needs: deploy | |
| if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Setup node | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | |
| with: | |
| node-version: "22" | |
| cache: "yarn" | |
| - name: Install dependencies | |
| run: yarn --frozen-lockfile --prefer-offline --ignore-scripts | |
| - name: Install Playwright | |
| run: npx playwright install --with-deps chromium | |
| - name: Get production sitemap hash | |
| id: sitemap-hash | |
| run: | | |
| hash=$(curl -fsSL https://docusaurus-openapi.tryingpan.dev/sitemap.xml | sha256sum | cut -d' ' -f1) | |
| echo "hash=$hash" >> "$GITHUB_OUTPUT" | |
| - name: Capture production screenshots | |
| run: yarn ts-node scripts/sitemap-visual-diff.ts --preview-url https://docusaurus-openapi.tryingpan.dev/ --concurrency 4 --paths "/tests/" | |
| - name: Save production screenshots | |
| uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 | |
| with: | |
| path: visual_diffs/prod | |
| key: prod-screenshots-${{ steps.sitemap-hash.outputs.hash }} |