-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
83 lines (70 loc) · 2.79 KB
/
azure-pipelines.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
pool:
name: ### PoolName
stages:
- stage: Build
jobs:
- job: Build
steps:
- task: UseNode@1
displayName: 'Use Node 20.x'
inputs:
version: '20.x'
checkLatest: true
- task: YarnInstaller@3
displayName: 'Use Yarn 1.x'
inputs:
versionSpec: '1.x'
checkLatest: true
- script: yarn install
displayName: 'Install Dependencies'
- script: |
echo "=== Running type checks ==="
yarn check:types
echo "=== Running format checks ==="
yarn format:check
echo "=== Running lint ==="
yarn lint
displayName: 'Run Quality Checks'
- script: yarn build
displayName: 'Build App'
- script: yarn workspaces focus --production
displayName: 'Install Prod Dependencies'
- task: CopyFiles@2
displayName: 'Copy Prod Files'
inputs:
Content: |
.next/**
yarn.lock
node_modules/**
public/**
package.json
ecosystem.config.js
next.config.js
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: ArchiveFiles@2
displayName: 'Archive Prod Files'
inputs:
rootFolderOrFile: '$(Build.ArtifactStagingDirectory)'
includeRootFolder: false,
archiveType: 'zip',
archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
replaceExistingArchive: true
- task: PublishBuildArtifacts@1
displayName: 'Publish Prod Files'
inputs:
PathToPublish: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
ArtifactName: 'drop',
publishLocation: 'Container'
- task: AzureRmWebAppDeployment@4
displayName: 'Azure web app deployment'
inputs:
azureSubscription: ### Service Principal Connection
ResourceGroupName: ### Resource group Name
appType: 'webAppLinux',
WebAppName: ### App Service Name
deployToSlotOrASE: true ### For slot deployments, usefult for A/B Testing
SlotName: 'production' ### Can be a specific env slot name
packageForLinux: '$(Build.ArtifactStagingDirectory)/**/*.zip'
enableCustomDeployment: true
DeploymentType: 'zipDeploy'
StartUpCommand: 'yarn start' ### in package.json we are calling pm2 start, instead of native next js start command.