Merge remote-tracking branch 'origin/main' #27
This file contains hidden or 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 | |
| paths: | |
| - 'apps/fakeoverflow-angular/**' | |
| - '.github/workflows/deploy-angular-pages.yml' ##This file, any change, need to update | |
| # - 'scripts/prep-wrangler-jsonc.mjs' ## Any change in the script file | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 8 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| - name: Install Dependencies | |
| run: pnpm install | |
| - name: Build Services | |
| run: pnpm --filter fakeoverflow-angular-services run build | |
| - name: Build Angular application | |
| run: pnpm build:angular:prod --base-href="/FakeOverflow/" | |
| - name: Create 404.html for SPA routing | |
| run: cp ./apps/fakeoverflow-angular/dist/fakeoverflow-angular/browser/index.html ./apps/fakeoverflow-angular/dist/fakeoverflow-angular/browser/404.html | |
| - name: Verify build output | |
| run: | | |
| echo "Build output structure:" | |
| ls -la ./apps/fakeoverflow-angular/dist/fakeoverflow-angular/browser/ | |
| echo "Files to deploy:" | |
| find ./apps/fakeoverflow-angular/dist/fakeoverflow-angular/browser/ -type f | head -10 | |
| - name: Setup GitHub Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./apps/fakeoverflow-angular/dist/fakeoverflow-angular/browser | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |