diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 1373a27..944980a 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -9,7 +9,6 @@ on: - package.json - package-lock.json - .github/workflows/deploy-docs.yml - tags: ['v*'] workflow_dispatch: {} permissions: @@ -23,12 +22,10 @@ concurrency: jobs: build: + if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: - # Always build from main, never from the triggering ref: on a v* tag push - # github.ref is the tag, and site/next would then be built from the tag's - # spec instead of the current main HEAD. Released versions are read out of - # git history (git show :spec), so they are unaffected by this. + # Build next from main and released versions from their tags. - uses: actions/checkout@v4 with: ref: main @@ -48,7 +45,7 @@ jobs: runs-on: ubuntu-latest environment: name: github-pages - url: ${{ steps.deployment.outputs.page_url }} + url: https://openapi.apolloconfig.com steps: - id: deployment uses: actions/deploy-pages@v4 diff --git a/.github/workflows/dispatch-docs.yml b/.github/workflows/dispatch-docs.yml new file mode 100644 index 0000000..0d12977 --- /dev/null +++ b/.github/workflows/dispatch-docs.yml @@ -0,0 +1,21 @@ +name: Dispatch API Docs Deployment +on: + push: + tags: ['v*'] + +permissions: + actions: write + +jobs: + dispatch: + if: github.event.deleted == false + runs-on: ubuntu-latest + steps: + # Tag deployments can report success while Pages keeps serving old content. + # https://github.com/actions/deploy-pages/issues/383 + - name: Start a deployment from main + env: + GH_TOKEN: ${{ github.token }} + run: | + gh workflow run deploy-docs.yml \ + --repo "$GITHUB_REPOSITORY" --ref main diff --git a/README.md b/README.md index bb7b487..78b5ea5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # apollo-openapi ![OpenAPI](https://img.shields.io/badge/spec-OpenAPI%203.0.1-blue) -[![Docs](https://img.shields.io/badge/docs-API%20reference-blue)](https://apolloconfig.github.io/apollo-openapi/) +[![Docs](https://img.shields.io/badge/docs-API%20reference-blue)](https://openapi.apolloconfig.com/) This repository maintains the Apollo OpenAPI contract. The source of truth is [`apollo-openapi.yaml`](apollo-openapi.yaml). @@ -11,9 +11,14 @@ This repository maintains the Apollo OpenAPI contract. The source of truth is Browse the rendered API reference for every released version (plus `next` for the unreleased `main` HEAD): -**https://apolloconfig.github.io/apollo-openapi/** +**https://openapi.apolloconfig.com/** -See [all versions](https://apolloconfig.github.io/apollo-openapi/versions.html). +See [all versions](https://openapi.apolloconfig.com/versions.html). + +Documentation changes on `main` deploy automatically. A `v*` tag push starts +the deployment workflow on `main` using `workflow_dispatch`, avoiding the +[Pages tag deployment issue](https://github.com/actions/deploy-pages/issues/383). +To retry a deployment, run **Deploy API Docs** manually on `main`. Generated code is treated as a temporary verification artifact, not as maintained source code or an official Apollo SDK. Apollo Portal pins a released