-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (60 loc) · 1.95 KB
/
deployAgilitySports.js.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# 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 }}/