This guide explains how to deploy mindstack to GitHub Pages using GitHub Actions.
- A GitHub account
- A GitHub repository (public or private)
- Git installed on your local machine
# Initialize git (if not already done)
git init
# Add all files
git add .
# Commit
git commit -m "Initial commit: mindstack learning platform"
# Add remote (replace with your repository URL)
git remote add origin https://github.com/yourusername/mindstack.git
# Push to GitHub
git branch -M main
git push -u origin main- Go to your repository on GitHub
- Click on Settings (in the repository menu)
- Scroll down to Pages (in the left sidebar)
- Under Source, select GitHub Actions (not "Deploy from a branch")
- Click Save
Edit mkdocs.yml and update the repository URL:
repo_url: https://github.com/yourusername/mindstack
repo_name: mindstackReplace yourusername with your actual GitHub username.
The GitHub Actions workflow will automatically run when you push to the main or master branch:
git add mkdocs.yml
git commit -m "Update repository URL"
git push- Go to your repository on GitHub
- Click on the Actions tab
- You should see a workflow run called "Deploy to GitHub Pages"
- Wait for it to complete (usually takes 1-2 minutes)
Once deployment is complete, your site will be available at:
https://yourusername.github.io/mindstack
Note: It may take a few minutes for the site to be accessible after the first deployment.
The GitHub Actions workflow (.github/workflows/ci.yml) does the following:
- Triggers: Runs on push to
main/masterbranch or manual trigger - Builds: Installs dependencies and builds the MkDocs site
- Deploys: Uploads the built site to GitHub Pages
-
Check GitHub Pages Settings:
- Ensure "GitHub Actions" is selected as the source
- Not "Deploy from a branch"
-
Check Workflow Status:
- Go to Actions tab
- Check if the workflow completed successfully
- Review any error messages
-
Check Permissions:
- Go to Settings → Actions → General
- Under "Workflow permissions", ensure "Read and write permissions" is selected
-
Check Requirements:
- Ensure
requirements.txtis up to date - All dependencies are specified
- Ensure
-
Check mkdocs.yml:
- Verify YAML syntax is correct
- Ensure all referenced files exist
-
View Logs:
- Go to Actions tab
- Click on the failed workflow run
- Review the build logs for errors
To use a custom domain:
- Add a
CNAMEfile in thedocs/directory:
yourdomain.com
-
Configure DNS settings for your domain to point to GitHub Pages
-
Update
mkdocs.yml:
site_url: https://yourdomain.comIf you prefer to deploy manually:
# Build the site
mkdocs build
# Deploy to GitHub Pages
mkdocs gh-deployThis creates a gh-pages branch and deploys manually. However, using GitHub Actions is recommended for automatic deployments.
Simply push changes to the main branch:
git add .
git commit -m "Update course content"
git pushThe workflow will automatically rebuild and redeploy your site.