GitHub Actions Static Deploy
Ensure your showcase is always in sync with your source code.
Workflow Configuration
- Triggers: Trigger on every
pushto themasterormainbranch. - Permissions: Grant
contents: writeor use the dedicatedpagesdeployment token.
Essential Steps
- Checkout: Use
actions/checkout. - Build: (Optional) Run minification or bundling scripts.
- Deploy: Use the
peaceiris/actions-gh-pagesaction to push the static folder to thegh-pagesbranch.
Best Practices
- Custom Domain CNAME: Ensure your
CNAMEfile is included in the build/deployment folder to prevent domain resets. - Build Notifications: Notify a Slack or Discord channel on successful or failed deployments.