diff --git a/.github/workflows/deploy-ghpage.yml b/.github/workflows/deploy-ghpage.yml index 0d5ec8f..4ae8847 100644 --- a/.github/workflows/deploy-ghpage.yml +++ b/.github/workflows/deploy-ghpage.yml @@ -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/angular-deploy-gh-pages-actions@v1.4.0 ## 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