diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml new file mode 100644 index 0000000000..09141772a8 --- /dev/null +++ b/.github/workflows/publish-docs.yml @@ -0,0 +1,36 @@ +name: 📚 Publish docs + +on: + push: + tags: + - "docs-release-*" + +# Only needs to move the docs-live ref; Mintlify's GitHub app deploys from it. +permissions: + contents: write + +concurrency: + group: publish-docs + cancel-in-progress: false + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: 📥 Checkout tagged commit + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: 🔗 Check for broken links + working-directory: ./docs + run: npx mintlify@4.0.393 broken-links + + - name: 🚀 Fast-forward docs-live to the tagged commit + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh api -X PATCH \ + "repos/${{ github.repository }}/git/refs/heads/docs-live" \ + -f sha="${{ github.sha }}" \ + -F force=false