forked from hartjus/ffthh-ado
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
47 lines (41 loc) · 1.33 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
# 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
variables:
- name: subscriptionName
value: AzureServiceConnection
- name: storageContainer
value: "$web"
- name: storageAccount
value: ffthhstoragetg
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: '22.x'
displayName: 'Install Node.js'
- script: |
yarn install
yarn build
CI=true yarn test
displayName: 'npm install and build'
- task: AzureCLI@2
displayName: Upload to Azure Storage Account
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
inputs:
azureSubscription: '$(subscriptionName)'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
echo "STEP: Setup"
az --version
az account show
az config set extension.use_dynamic_install=yes_without_prompt
echo "STEP: Removing blobs from storage"
az storage azcopy blob delete -c '$(storageContainer)' --account-name '$(storageAccount)' --recursive
echo "STEP: Uploading blobs to storage"
az storage azcopy blob upload -c '$(storageContainer)' --account-name '$(storageAccount)' -s "build/*" --recursive