-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
57 lines (47 loc) · 1.35 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
# Node.js with React
# Step 1: Pull the code
# Step 2: Install the dependencies & build
# Step 3: Collect artifacts
# Step 4: Deploy to server
trigger:
- master
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: '14.17'
displayName: 'Install Node.js'
- bash: |
git push --prune https://$(GITHUB_PAT)@github.com/$(REPO_PATH).git \
+refs/remotes/origin/*:refs/heads/* +refs/tags/*:refs/tags/*
displayName: 'Mirror to GitHub'
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
- script: |
yarn config set network-timeout 300000
yarn install
yarn run build-prod
displayName: 'Run yarn install and build'
- task: PublishPipelineArtifact@1
inputs:
targetPath: $(System.DefaultWorkingDirectory)/build
artifactName: build
- script: |
tar czvf build.tar.gz build
displayName: 'Tarball the artifact'
- task: PublishPipelineArtifact@1
inputs:
targetPath: $(System.DefaultWorkingDirectory)/build.tar.gz
artifactName: build_tarball
- task: CopyFilesOverSSH@0
inputs:
sshEndpoint: TARGET_SERVER
overwrite: true
sourceFolder: 'build'
targetFolder: '/home/xjtluoj/.ci_build_frontend/artifacts'
- task: SSH@0
inputs:
sshEndpoint: TARGET_SERVER
runOptions: 'commands'
commands: '/home/xjtluoj/.ci_build_frontend/deploy.sh'
failOnStdErr: true