· John Dummy · 1 min read
Continuous Deployment Pipeline
How we use bin/deploy to safely publish content while protecting private posts.
This blog implements a secure deployment pipeline designed to handle the separation of public code and private content.
The bin/deploy Workflow
The deployment process is orchestrated by a single command: ./bin/deploy. When run, it performs the following sequence:
- Content Sync: It pulls the latest Markdown and assets from your
blog-contentrepository. - Asset Consolidation: Images pasted in VSCode are moved from local post folders to the central Astro assets directory.
- Path Rewriting: Markdown image links are updated to point to the new asset locations.
- Static Build: Astro compiles the site, generating optimized HTML, CSS, and images.
- Security Audit: The script runs an explicit check to ensure:
- No
privatecontent has been accidentally placed in thepublic/directory. - No
draft: trueposts are included in the build output.
- No
- Cloudflare Upload: If all checks pass, the site is uploaded directly to Cloudflare Pages.
Why Separate Repositories?
We use two distinct repositories:
- blog-code: Publicly visible. Contains the engine, layouts, and styles.
- blog-content: Private. Contains the actual posts and sensitive draft data.
This separation ensures that even if someone explores the public code, they never gain access to your historical drafts or private posts.
Production Environment
The production site is hosted on Cloudflare Pages, benefitting from their global CDN and Cloudflare Access for secure, Zero Trust authentication.