This workflow automatically builds and deploys preview versions of the site when you push to branches in your fork. This allows you to review your changes before creating a PR to the main project.
- Fork the
github/training-kitrepository - Push changes to any branch (except
mainorgh-pages) - The workflow automatically builds the Jekyll site and deploys to your fork's GitHub Pages
- Preview is available at:
https://your-username.github.io/training-kit/preview/branch-name/ - Review your changes before creating a PR to the main project
After you push your first branch, the workflow will create a gh-pages branch. Then:
- Go to your fork's Settings → Pages
- Under "Source", select Deploy from a branch
- Select gh-pages branch and / (root) folder
- Click Save
- GitHub Pages will be available at:
https://your-username.github.io/training-kit/
That's it! The workflow uses GITHUB_TOKEN which is automatically available in GitHub Actions - no PAT needed.
Previews are organized by branch name:
https://{your-username}.github.io/training-kit/preview/{branch-name}/
For example:
- Branch
add-spanish-translation→https://johndoe.github.io/training-kit/preview/add-spanish-translation/ - Branch
fix/typo→https://johndoe.github.io/training-kit/preview/fix-typo/(slashes replaced with dashes)
- Fork the repository
- Enable GitHub Pages (one-time setup, see above)
- Create a branch with your changes
- Push to your fork
- Check Actions tab for the deployment status
- Review your preview at the URL shown in the workflow output
- Create PR to the main project once you're satisfied
After pushing, you can find the preview URL in two places:
-
GitHub Actions output:
- Go to your fork's Actions tab
- Click on the latest workflow run
- Expand the "Display preview URL" step
- Copy the preview URL
-
Direct URL pattern:
- Just use:
https://your-username.github.io/training-kit/preview/your-branch-name/
- Just use:
- ✅ No approval required - Runs automatically in your fork
- ✅ No PAT needed - Uses built-in
GITHUB_TOKEN - ✅ Preview before PR - Review changes before submitting to main project
- ✅ Multiple previews - Each branch gets its own preview URL
- ✅ Easy for translators - Non-technical contributors can see their work live
Just push new commits to the same branch - the preview updates automatically.
To remove old preview directories:
- Go to your fork
- Switch to the
gh-pagesbranch - Delete the
preview/branch-name/directory - Commit and push
Or use git:
git checkout gh-pages
git rm -rf preview/old-branch-name
git commit -m "Remove old preview"
git push- Main project workflow: Only deploys to production on push to
main - Fork preview workflow: Deploys every branch to a preview URL in your fork
- Runs only in forks (not in the main
github/training-kitrepository) - Uses
GITHUB_TOKENwith limited permissions - No secrets or PAT required
- Each contributor controls their own fork and previews
- Check if GitHub Pages is enabled in Settings → Pages
- Wait a few minutes - first deployment can take 5-10 minutes
- Check the Actions tab for any errors
- Make sure the branch name in the URL matches (slashes become dashes)
- Check if the workflow completed successfully
- Verify GitHub Pages is set to deploy from
gh-pagesbranch
- Make sure you pushed to a branch (not
mainorgh-pages) - Check that you're working in a fork, not the main repository
- Check the Actions tab is enabled in your fork settings