diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 0e6e23b..a9d8339 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -44,6 +44,14 @@ jobs: run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" env: JEKYLL_ENV: production + + - name: Deploy to Cloudflare Pages + uses: cloudflare/wrangler-action@ebbaa1584979971c8614a24965b4405ff95890e0 # v4.0.0 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + wranglerVersion: "4.125.0" + command: pages deploy docs/_site --project-name=gptcode --branch=main - name: Upload artifact uses: actions/upload-pages-artifact@v5 diff --git a/_roadmap.md b/_roadmap.md index e97fd32..e362479 100644 --- a/_roadmap.md +++ b/_roadmap.md @@ -22,6 +22,7 @@ engineering portfolio. - [x] Publish the site changes to the `main` branch. - [x] Move authoritative DNS for `gptcode.dev` from GoDaddy to Cloudflare. - [x] Associate `gptcode.dev` and `www.gptcode.dev` with Cloudflare Pages. +- [x] Deploy Jekyll changes merged to `main` automatically to Cloudflare Pages. - [x] Publish a race-safe example with behavior tests and 100% statement coverage enforced in CI. - [x] Replace the legacy scheduled/private release pipeline with explicit, verified tag releases. - [x] Verify custom-domain certificate activation and HTTPS after DNS propagation. diff --git a/docs/test/site_identity_test.rb b/docs/test/site_identity_test.rb index 55170cc..d21bab7 100644 --- a/docs/test/site_identity_test.rb +++ b/docs/test/site_identity_test.rb @@ -17,6 +17,23 @@ def test_primary_domain_is_gptcode_dev assert_includes File.read(File.join(DOCS_ROOT, "_config.yml")), 'url: "https://gptcode.dev"' end + def test_main_site_workflow_deploys_to_cloudflare_pages + workflow = File.read( + File.join(REPO_ROOT, ".github", "workflows", "pages.yml") + ) + + assert_includes workflow, + "cloudflare/wrangler-action@ebbaa1584979971c8614a24965b4405ff95890e0" + assert_includes workflow, + 'apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}' + assert_includes workflow, + 'accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}' + assert_includes workflow, + "pages deploy docs/_site --project-name=gptcode --branch=main" + refute_includes workflow, "gitHubToken:" + refute_includes workflow, "deployments: write" + end + def test_site_points_to_personal_repository assert_includes combined_content, "https://github.com/jadercorrea/gptcode" refute_includes combined_content, "github.com/gptcode-cloud"