This document explains the automated deployment workflow for the Open Hardware Initiative website.
GitHub Actions automatically builds and deploys the website whenever changes are pushed to the main branch. The workflow is located at .github/workflows/deploy.yml.
- Checkout repository code
- Setup Bun for faster dependency installation
- Install dependencies in
Source code/directory - Build project using
bun run build - Upload artifacts from
Source code/dist/
- Deploy to GitHub Pages using the uploaded artifacts
- Update live site with new content
- Site goes live at open-hardware-initiative.com
.github/workflows/deploy.yml
on:
push:
branches: ["main"] # Triggers on main branch pushes
workflow_dispatch: # Allows manual triggering
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
working-directory: ./Source code
run: bun install
- name: Build project
working-directory: ./Source code
run: bun run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './Source code/dist'
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4- Push to main branch → Workflow starts automatically
- Any file change triggers a new deployment
- No manual intervention required
- Go to Actions tab in repository
- Click "Deploy static content to Pages"
- Click "Run workflow"
- Select main branch
- Click "Run workflow"
- Build time: ~2-3 minutes
- Deployment time: ~30 seconds
- Total time: ~3-4 minutes
index.html- Main websiteassets/- CSS, JavaScript, imagesCNAME- Custom domain configurationrobots.txt- Search engine configuration404.html- Custom error page- All static assets from
public/folder
- Go to Actions tab in repository
- Look for latest "Deploy static content to Pages" run
- Green checkmark = successful deployment
- Red X = deployment failed
- Click on the workflow run
- Expand each step to see detailed logs
- Look for error messages in failed steps
Symptoms: Red X in build step Solutions:
- Check TypeScript errors:
bun run lint - Verify all imports are correct
- Check for missing dependencies
Symptoms: Red X in deploy step Solutions:
- Check GitHub Pages settings
- Verify CNAME file exists
- Check repository permissions
Symptoms: Changes not visible on live site Solutions:
- Check workflow completed successfully
- Clear browser cache
- Wait 2-3 minutes for propagation
-
Test Build Locally
cd "Source code" bun run build
-
Check Workflow Logs
- Go to Actions tab
- Click on failed workflow
- Review error messages
-
Verify File Structure
- Ensure all required files exist
- Check file paths are correct
- Source: GitHub Actions
- Custom domain: open-hardware-initiative.com
- Enforce HTTPS: ✅ Checked
permissions:
contents: read
pages: write
id-token: write- Bun for faster dependency installation
- Vite for optimized builds
- Tree shaking to remove unused code
- Asset compression for smaller file sizes
- Parallel jobs for faster processing
- Caching of dependencies
- Optimized artifact upload
- ✅ Source code is version controlled
- ✅ Build process is automated
- ✅ No manual deployment steps
- ✅ HTTPS enforced
- Never commit sensitive data
- Use environment variables for secrets
- Keep dependencies updated
- Review workflow changes
If something goes wrong:
- Go to Actions tab
- Find a previous successful deployment
- Click "Re-run jobs"
- This will redeploy the previous version