name: Sync planet-scale guide to the website # The guide's source lives here (docs/planet-scale-guide/ — see its own # README.html), since keeping it next to the code it documents is what keeps # it honest. This mirrors it into the public elevenmessenger/website repo # (src/infrastructure/, passthrough-copied by Eleventy — see .eleventy.js # there) so it's reachable at elevenmessenger.com/infrastructure/ too, # without ever duplicating the source by hand. A push to website's main # branch triggers its own existing deploy.yml automatically. on: push: branches: [main] paths: - 'docs/planet-scale-guide/**' workflow_dispatch: concurrency: group: sync-guide-to-website cancel-in-progress: false jobs: sync: runs-on: ubuntu-latest steps: - name: Checkout the guide source uses: actions/checkout@v4 with: sparse-checkout: docs/planet-scale-guide sparse-checkout-cone-mode: true # Read-only source checkout; the push below uses the website # checkout's own WEBSITE_REPO_TOKEN, not this credential. persist-credentials: false - name: Check for the website repo token id: check-token run: | if [ -z "${{ secrets.WEBSITE_REPO_TOKEN }}" ]; then echo "skip=true" >> "$GITHUB_OUTPUT" echo "::warning::WEBSITE_REPO_TOKEN secret not set — skipping guide sync. See docs/planet-scale-guide/README.html § Publishing to elevenmessenger.com." else echo "skip=false" >> "$GITHUB_OUTPUT" fi - name: Checkout elevenmessenger/website if: steps.check-token.outputs.skip != 'true' uses: actions/checkout@v4 with: repository: elevenmessenger/website token: ${{ secrets.WEBSITE_REPO_TOKEN }} path: website - name: Copy the guide into website's passthrough directory if: steps.check-token.outputs.skip != 'true' run: | rm -rf website/src/infrastructure mkdir -p website/src/infrastructure cp -r docs/planet-scale-guide/* website/src/infrastructure/ - name: Commit and push if the guide changed if: steps.check-token.outputs.skip != 'true' working-directory: website run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add src/infrastructure if git diff --cached --quiet; then echo "No changes to the guide — nothing to sync." else git commit -m "docs: sync planet-scale guide from elevenmessenger/messenger@${GITHUB_SHA::7}" git push fi