Deployment
girok-md can be deployed to GitHub Pages, Vercel, Netlify, or any static hosting platform.
GitHub Pages (Recommended)
-
Create the workflow file
Create
.github/workflows/deploy.yml:.github/workflows/deploy.yml name: Deploy to GitHub Pageson:push:branches: [main]workflow_dispatch:permissions:contents: readpages: writeid-token: writeconcurrency:group: pagescancel-in-progress: falsejobs:build:runs-on: ubuntu-lateststeps:- name: Checkoutuses: actions/checkout@v4- name: Setup Nodeuses: actions/setup-node@v4with:node-version: 20cache: npm- name: Install dependenciesrun: npm ci- name: Buildrun: npm run build- name: Upload artifactuses: actions/upload-pages-artifact@v3with:path: ./distdeploy:needs: buildruns-on: ubuntu-latestenvironment:name: github-pagesurl: ${{ steps.deployment.outputs.page_url }}steps:- name: Deploy to GitHub Pagesid: deploymentuses: actions/deploy-pages@v4 -
Configure GitHub Pages
- Go to your repository’s Settings → Pages
- Under Source, select GitHub Actions
- Save the settings
-
Push to deploy
Terminal window git add .git commit -m "Add GitHub Pages deployment"git pushYour site will be available at
https://username.github.io/repository-name
Custom Domain
To use a custom domain:
-
Create a
CNAMEfile inpublic/:public/CNAME your-domain.com -
Update
setting.toml:setting.toml site_url = "https://your-domain.com" -
Configure DNS with your domain provider
Other Platforms
- Import your repository on Vercel
- Configure build settings:
- Framework Preset:
Astro - Build Command:
npm run build - Output Directory:
dist
- Framework Preset:
- Deploy
- Connect your repository on Netlify
- Configure build settings:
- Build Command:
npm run build - Publish Directory:
dist
- Build Command:
- Deploy
- Connect your repository on Cloudflare Pages
- Configure build settings:
- Framework Preset:
Astro - Build Command:
npm run build - Build output directory:
dist
- Framework Preset:
- Deploy
Docker
Run your blog in a Docker container. Just mount your markdown folder and setting.toml — the container handles syncing, building, and serving automatically.
Prerequisites
- Docker installed on your machine
Quick Start
-
Set
source_root_pathinsetting.tomlThe container mounts your markdown folder to
/source, so the path must match:setting.toml source_root_path = "/source" -
Build the Docker image
Terminal window docker build -t girok-md . -
Run the container
Terminal window docker run -d -p 8080:8080 \-v /path/to/your/markdown-folder:/source:ro \-v ./setting.toml:/app/setting.toml:ro \girok-md- Replace
/path/to/your/markdown-folderwith the actual path to your markdown files :romeans read-only — your original files are never modified- The blog will be available at
http://localhost:8080
- Replace
Using Docker Compose
For a simpler workflow, edit docker-compose.yml and run with a single command:
services: blog: build: . ports: - "8080:8080" volumes: - /path/to/your/markdown-folder:/source:ro - ./setting.toml:/app/setting.toml:rodocker compose up -dHow It Works
The container runs through three steps on startup:
- Sync — copies markdown files from
/sourceinto the project - Build — generates static HTML pages and search index
- Serve — starts Nginx to serve the built site on port 8080
Rebuilding After Content Changes
The container builds the site once at startup. To pick up new or updated markdown files, restart the container:
docker compose down && docker compose up -dManual Deployment
Build your site locally and upload to any static host:
npm run buildThe built site will be in the dist/ folder:
Directorydist/
- index.html
Directoryposts/
Directorymy-first-post/
- index.html
Directorytags/
- …
Directorypagefind/
- …
Directoryassets/
- …
Directory_astro/
- …
Upload the contents of dist/ to your web server.
Build Configuration
Base Path
If deploying to a subdirectory (e.g., username.github.io/blog), update astro.config.mjs:
export default defineConfig({ site: 'https://username.github.io', base: '/blog', // ...});Environment Variables
For production builds, you can use environment variables:
PUBLIC_SITE_URL=https://your-site.com npm run build