trigger action #1
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
| # Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy | |
| # More GitHub Actions for Azure: https://github.com/Azure/actions | |
| name: Build and Deploy | |
| on: | |
| push: | |
| branches: | |
| - deploy-with-single-action | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build Angular App | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '22.x' | |
| - name: Install dependencies and build | |
| run: | | |
| npm install | |
| npm run build:azure | |
| - name: Upload artifact for test/deploy jobs | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: angular-app | |
| path: ./dist/browser # package all files in dist/browser and name the artifact "node-app" | |
| test: | |
| name: Run Unit and E2E Tests | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '22.x' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run unit tests | |
| run: npm run test:headless | |
| - name: Run e2e tests | |
| run: npm run e2e:headless | |
| deploy-azure-text-compare: | |
| name: Deploy to Azure text-1 | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - name: Download build artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: angular-app # download the artifact and extract to the current working directory | |
| - name: Deploy to Azure text-compare | |
| id: deploy-to-text1 | |
| uses: azure/webapps-deploy@v3 | |
| with: | |
| app-name: 'text-compare' | |
| slot-name: 'Production' | |
| package: . # deploy with all files in the current working directory | |
| publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_4F4C478D91D44F8BBEF8951570103698 }} | |
| clean: true | |
| deploy-azure-text-compare2: | |
| name: Deploy to Azure text-2 | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - name: Download build artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: angular-app # download the artifact and extract to the current working directory | |
| - name: Deploy to Azure text-compare2 | |
| id: deploy-to-text2 | |
| uses: azure/webapps-deploy@v3 | |
| with: | |
| app-name: 'text-compare2' | |
| slot-name: 'Production' | |
| package: . # deploy with all files in the current working directory | |
| publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_23137CCA3349499E9B3DCC0705F4C348 }} | |
| clean: true | |
| deploy-github-pages: | |
| name: Deploy to GitHub Pages | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.x' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build Angular app | |
| run: npm run build:pages2 | |
| - name: Deploy to GitHub Pages | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| branch: gh-pages | |
| folder: dist/browser | |
| clean: true |