This guide explains how to deploy the Angular Tailwind Template.
🔗 View Live Demo (GitHub Pages)
Deploy as a static site on GitHub Pages – no server costs.
- Go to your repository on GitHub
- Settings → Pages
- Under Source, select GitHub Actions
The workflow .github/workflows/gh-pages.yml runs automatically on every push to main:
- Installs dependencies
- Builds with
npm run build:gh-pages(sets--base-href /angular-tailwind-template/) - Copies
index.html→404.html(SPA routing fix) - Deploys to GitHub Pages
After the first successful workflow run, your app is live at:
https://heyding.github.io/angular-tailwind-template/
You can also trigger the deployment manually:
- Go to Actions → Deploy to GitHub Pages
- Click Run workflow → Run workflow
- In repo Settings → Pages → Custom domain, enter your domain
- Add a CNAME record at your DNS provider pointing to
heyding.github.io - Update
build:gh-pagesinpackage.jsonto use--base-href /instead
- GitHub Pages serves static files only – no server-side API calls
- The
404.htmltrick handles SPA routing, but crawlers may not follow all routes - Free for public repos, included in GitHub Pro/Team for private repos
Test the production build locally before deploying:
# Build the Docker image
docker build -t angular-tailwind-template .
# Run the container
docker run -p 8080:80 angular-tailwind-template
# Or use docker-compose
docker-compose upVisit http://localhost:8080 to test the app.
curl http://localhost:8080/health
# Should return: healthyError: npm install fails
# Solution: Add --legacy-peer-deps flag in Dockerfile (already included)
RUN npm ci --legacy-peer-depsError: Health check fails
# Check if nginx is serving on port 80
# Verify nginx.conf is correct
# Check the /health endpointError: Angular routes return 404
# Solution: Ensure nginx.conf has this rule (already included):
try_files $uri $uri/ /index.html;- HTTPS is enabled by default on GitHub Pages
- Security headers are configured in
nginx.conf(for Docker deployments)
Before deploying:
- Enable GitHub Pages in repository settings (Source: GitHub Actions)
- Test locally with Docker
- Configure custom domain (optional)
- Update README with live demo link