-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
25 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,33 @@ | ||
name: Build and Deploy | ||
name: Deploy Angular App to GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build: | ||
- main # Adjust this to your default branch | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: All things angular | ||
uses: AhsanAyaz/[email protected] ## replace by latest version without it you will see Expected format {org}/{repo}[/path]@ref. Actual 'AhsanAyaz/angular-deploy-gh-pages-actions',Input string was not in a correct format. | ||
with: | ||
github_access_token: ${{ secrets.GHPAGES }} | ||
build_configuration: production # The build environment for the app. please look configurations in your angular.json | ||
deploy_branch: gh-pages # The branch the action should deploy to. | ||
angular_project_dir: ./frontend | ||
base_href: '' # empty | ||
angular_dist_build_folder: ../dist # The folder where your project is supposed to be after running ng build by the action. | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 # Ensure this matches your project's Node.js version | ||
|
||
- name: Install Dependencies | ||
run: npm install | ||
working-directory: frontend/angularApp | ||
|
||
- name: Build Angular App | ||
run: npm run build -- --output-path ../dist | ||
working-directory: frontend/angularApp | ||
|
||
permissions: | ||
contents: write # Allow write permission to GITHUB_TOKEN to commit to deploy branch. | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GH_PAGES }} | ||
publish_dir: dist |