-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontinuous-deployment.yml
More file actions
79 lines (66 loc) · 1.89 KB
/
continuous-deployment.yml
File metadata and controls
79 lines (66 loc) · 1.89 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Node.js with React
# Build a Node.js project that uses React.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
branches:
include:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: "14.x"
checkLatest: true
displayName: "Install Node.js"
- script: |
yarn
cd api
yarn
displayName: "Install dependencies for React & API"
- script: |
yarn prettier:ci
displayName: "Run Prettier check"
- script: |
yarn test:ci
cd api
yarn test:ci
displayName: "Run unit tests"
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testRunner: JUnit
testResultsFiles: "**/junit.xml"
- script: |
yarn build
cd api
yarn build
displayName: "Build React & API"
- task: DownloadSecureFile@1
name: environmentFile
inputs:
secureFile: ".env"
- script: |
sudo mv $(environmentFile.secureFilePath) api/
sudo rm -r api/node_modules
displayName: "Move .env to API directory and remove node modules"
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: "$(System.DefaultWorkingDirectory)/api"
includeRootFolder: false
- task: PublishPipelineArtifact@1
inputs:
targetPath: "$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip"
artifactName: WebApp
- task: AzureRmWebAppDeployment@4
displayName: "Azure App Service Deploy"
inputs:
azureSubscription: "Azure for Students (e8a9055c-d984-4ad3-ae8b-c14693b851a3)"
appType: webAppLinux
WebAppName: what2douts
packageForLinux: "$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip"
RuntimeStack: "NODE|14-lts"
ScriptType: "Inline Script"
InlineScript: |
benv node=14 yarn install --production