Last active
April 13, 2026 08:39
-
-
Save marcominerva/0be25c3dcf0460cdcdc0f906c23f7a7c to your computer and use it in GitHub Desktop.
Minimal GitHub action to deploy an Angular app on Azure App Service
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 on Azure | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [ master ] | |
| paths: [ 'src/**' ] | |
| workflow_dispatch: | |
| env: | |
| AZURE_WEBAPP_NAME: <app_name> | |
| AZURE_WEBAPP_PACKAGE_PATH: './published' | |
| NODE_VERSION: '22.x' | |
| PROJECT_PATH: src/<project_folder> | |
| PROJECT_NAME: <project_name> | |
| jobs: | |
| build-and-deploy: | |
| name: Build and Deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js ${{ env.NODE_VERSION }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| cache-dependency-path: ${{ env.PROJECT_PATH }}/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| working-directory: ${{ env.PROJECT_PATH }} | |
| - name: Build | |
| run: npx ng build --configuration production | |
| working-directory: ${{ env.PROJECT_PATH }} | |
| - name: Copy build output | |
| run: cp -r ${{ env.PROJECT_PATH }}/dist/${{ env.PROJECT_NAME }}/browser ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} | |
| - name: Deploy to Azure Web App | |
| uses: azure/webapps-deploy@v2 | |
| with: | |
| app-name: ${{ env.AZURE_WEBAPP_NAME }} | |
| publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} | |
| package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment