Merge pull request #46 from smagara/loadingmsg #26
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
# Build and deploy Angular web application AgilitySports_web, with pruning to keep the filecount minimal | |
name: Build and Deploy AgilitySports_web | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
env: | |
AZURE_WEBAPP_NAME: AgilitySportsTest41 | |
AZURE_WEBAPP_PACKAGE_PATH: './dist' | |
NODE_VERSION: '20.x' | |
UPLOAD_ARCHIVE_NAME: 'agility-sports' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: 'npm' | |
- name: Install Angular CLI | |
run: npm install -g @angular/cli | |
- name: Install dependencies | |
run: npm install | |
- name: Build | |
run: ng build --configuration production | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.UPLOAD_ARCHIVE_NAME }} | |
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/** | |
# Debugging: List the contents of the directory where the build artifacts are | |
- name: List contents of the build directory | |
run: ls -R ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: none | |
environment: | |
name: 'Production' | |
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | |
steps: | |
- name: Where are we | |
run: echo $(pwd) | |
- name: Where is GitHub's agent running | |
run: echo ${{ github.workspace }} | |
- name: Download artifact from build job "dist" folder to this workspace | |
uses: actions/download-artifact@v3 | |
with: | |
name: ${{ env.UPLOAD_ARCHIVE_NAME }} | |
- name: 'Deploy to Azure WebApp' | |
id: deploy-to-webapp | |
uses: azure/webapps-deploy@v2 | |
with: | |
app-name: ${{ env.AZURE_WEBAPP_NAME }} | |
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} | |
package: ${{ github.workspace }}/ |