This guide will help you deploy your Vault Frontend to GitHub Pages.
- GitHub Repository: Make sure your code is pushed to a GitHub repository
- Node.js: Ensure you have Node.js installed
- Git: Make sure Git is configured with your GitHub credentials
# Navigate to the frontend directory
cd Vault-Frontend
# Run the deployment script
./deploy.sh# Navigate to the frontend directory
cd Vault-Frontend
# Build for GitHub Pages
npm run build:gh-pages
# Deploy to GitHub Pages
npm run deploybuild:gh-pages: Builds the Angular app with the correct base href for GitHub Pages (/Vault/)deploy: Uses gh-pages to push the built files to thegh-pagesbranchpredeploy: Automatically runs before deploy to ensure the latest build is used
After your first deployment, you'll need to configure GitHub Pages:
- Go to your GitHub repository
- Click on Settings tab
- Scroll down to Pages section
- Under Source, select Deploy from a branch
- Choose gh-pages branch
- Select / (root) folder
- Click Save
Once deployed, your site will be available at:
https://[your-github-username].github.io/Vault/
- 404 Error: Make sure GitHub Pages is configured to use the
gh-pagesbranch - Assets not loading: Ensure the base href is correctly set to
/Vault/ - Build fails: Check for TypeScript or linting errors
- Deployment fails: Verify your Git credentials and repository permissions
If you need to change the base href, update the build:gh-pages script in package.json:
"build:gh-pages": "ng build --configuration production --base-href /your-repo-name/"To update your deployed site:
- Make your changes to the code
- Run
./deploy.shornpm run deploy - Wait a few minutes for GitHub Pages to update
Make sure your production environment is properly configured in:
src/environments/environment.prod.ts
This file is used during the production build process.