Shinmun exports to static HTML for free hosting on GitHub Pages. Two deployment methods: manual export or GitHub Actions automation.
shinmun export docs
git add docs && git commit -m "Export site"
git pushIn repository Settings → Pages, select main branch and /docs folder.
Create .github/workflows/deploy.yml:
name: Deploy
on:
push:
branches: [main]
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.0'
bundler-cache: true
- run: bundle exec shinmun export _site
- uses: actions/upload-pages-artifact@v3
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/deploy-pages@v4
id: deploymentIn Settings → Pages, set Source to GitHub Actions.
Add a CNAME file to public/ with your domain. Configure DNS:
username.github.ioFor project sites at /repo-name/, set base_path in config.yml:
base_path: /repo-nameTemplates use <%= base_path %> for asset paths.
Posted in category Ruby. Tagged with deployment, github, static-site.