Deployment
GitHub Pages Deployment
The DISC website is automatically deployed to GitHub Pages using GitHub Actions.
Automated Deployment Process
The deployment is triggered automatically when:
- Code is pushed to the
mainbranch - A pull request is merged into
main
Our GitHub Action workflow:
- Checks out the repository
- Sets up Node.js
- Installs dependencies
- Builds the project
- Deploys to GitHub Pages
# Example of our deployment workflow
name: Deploy to GitHub Pages
on:
push:
branches:
- main
permissions:
contents: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
env:
NODE_ENV: production
- name: List public directory
run: ls -la public/
- name: List out directory
run: ls -la out/
- name: Add .nojekyll file
run: |
touch ./out/.nojekyll
cp -r public/* out/
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: out
branch: gh-pages
clean: true
Pre-deployment Checks
Before pushing to main, verify locally:
- Build succeeds:
npm run build - Links work correctly
- Images load properly
- Components render as expected
Troubleshooting
Common issues and solutions:
-
Build Failures
- Check the GitHub Actions logs for specific errors
- Verify all dependencies are properly listed in
package.json - Ensure Node.js version matches the workflow
-
404 Errors
- Verify the base path in
next.config.mjs - Check if images and assets use correct paths
- Ensure pages are properly exported
- Verify the base path in
-
Workflow Failures
- Check GitHub repository permissions
- Verify GitHub Actions is enabled
- Review workflow logs for specific errors