update version #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Angular App to GitHub Pages | |
on: | |
push: | |
branches: | |
- main # Trigger deploy only on changes to the 'main' branch | |
jobs: | |
build: | |
runs-on: ubuntu-latest # Using an Ubuntu runner | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 # Checkout the repository to the GitHub runner | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '21' # Specify Node.js version (LTS recommended, e.g., v16) | |
- name: Install dependencies | |
run: npm install # Install all project dependencies | |
- name: Build the Angular app | |
run: ng build --configuration=production --base-href="https://hemant10yadav.github.io/book-store/" # Build with production configuration and correct base-href | |
- name: Add .nojekyll file | |
run: echo > dist/book-store/.nojekyll # Create the .nojekyll file to prevent GitHub Pages from ignoring files starting with "_" | |
- name: Deploy to GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages # Deploy to the gh-pages branch | |
folder: dist/book-store # Path to the build output | |
clean: true # Clean the previous deployment |