name: specs on: push: branches: - master paths: - 'specs/**' - '.github/workflows/specs.yml' pull_request: paths: - 'specs/**' - '.github/workflows/specs.yml' concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: contents: read deployments: write pull-requests: write jobs: deploy: runs-on: ubuntu-latest if: > github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' steps: - name: checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 - name: build static site run: node specs/generate.mjs - name: deploy to Cloudflare Pages id: deploy uses: cloudflare/wrangler-action@953926a2e2182532811c01a25e53647d93bf07c0 # v4.1.3 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} gitHubToken: ${{ secrets.GITHUB_TOKEN }} command: > pages deploy specs/out --project-name=graphql-mesh-specs --branch=${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || 'master' }} # Same sticky-comment pattern as the-guild-org/shared-config website-cf (website.yml). - name: find preview comment uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4.0.0 id: fc if: github.event_name == 'pull_request' with: issue-number: ${{ github.event.pull_request.number }} comment-author: 'github-actions[bot]' body-includes: - name: create or update preview comment uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 if: github.event_name == 'pull_request' with: comment-id: ${{ steps.fc.outputs.comment-id }} issue-number: ${{ github.event.pull_request.number }} edit-mode: replace body: | ### 📄 Specs Preview The latest changes are available as preview in: [${{ steps.deploy.outputs.pages-deployment-alias-url }}](${{ steps.deploy.outputs.pages-deployment-alias-url }})