Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/docs-preview.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: docs-preview

# Asks the-guild-org/website (which builds and serves these docs at
# the-guild.dev/graphql/apollo-angular) to deploy a preview built with this PR's
# content. Same-repo PRs only: the dispatch needs a secret, which fork PRs
# don't receive — a maintainer can trigger the website repo's
# product-docs-preview workflow manually for those.

on:
pull_request:
paths:
- website/**

jobs:
request-preview:
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: request preview build
env:
TOKEN: ${{ secrets.WEBSITE_DISPATCH_TOKEN }}
run: |
curl --fail-with-body -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/repos/the-guild-org/website/dispatches \
-d "{\"event_type\":\"product-docs-preview\",\"client_payload\":{\"product\":\"apollo-angular\",\"pr\":\"${{ github.event.pull_request.number }}\"}}"

- name: comment preview link
env:
GH_TOKEN: ${{ github.token }}
PR: ${{ github.event.pull_request.number }}
run: |
url="https://apollo-angular-pr-${PR}.guild-dev-website.pages.dev/graphql/apollo-angular"
marker="<!-- docs-preview-link -->"
body="${marker}
📖 Docs preview (rebuilds on every push, ready ~10 min after each): ${url}"
existing=$(gh api "repos/${{ github.repository }}/issues/${PR}/comments" \
--jq ".[] | select(.body | startswith(\"${marker}\")) | .id" | head -1)
if [ -z "$existing" ]; then
gh api "repos/${{ github.repository }}/issues/${PR}/comments" -f body="$body" >/dev/null
fi
30 changes: 30 additions & 0 deletions .github/workflows/notify-website.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: notify-website

# The docs at the-guild.dev/graphql/apollo-angular are built by the-guild-org/website,
# which fetches this repo's website/ folder at build time. Tell it to
# redeploy whenever that content changes.
on:
push:
branches:
- master
paths:
- website/**

# The dispatch uses a PAT, so the workflow token needs no permissions at all.
permissions: {}

jobs:
dispatch:
runs-on: ubuntu-latest
steps:
- name: trigger website rebuild
env:
# Fine-grained PAT for the-guild-org/website with contents:write
# (repository_dispatch permission).
TOKEN: ${{ secrets.WEBSITE_DISPATCH_TOKEN }}
run: |
curl --fail-with-body -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/repos/the-guild-org/website/dispatches \
-d '{"event_type":"product-content-update","client_payload":{"product":"apollo-angular"}}'
48 changes: 0 additions & 48 deletions .github/workflows/website.yml

This file was deleted.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"ci-only:integration": "./scripts/integration tests",
"deploy": "pnpm run --recursive deploy",
"format": "prettier --write .",
"now-build": "(cd website && pnpm install && pnpm build && mv build ../public)",
"prebuild": "rimraf packages/*/build/",
"prerelease": "pnpm build",
"release": "changeset publish",
Expand Down
Loading
Loading