-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
60 lines (48 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
48
49
50
51
52
53
54
55
56
57
58
59
60
trigger:
tags:
include:
- "v*"
resources:
containers:
- container: node18
image: node:18-buster
pool:
docker
variables:
- group: pipeline
jobs:
- job: GitHubSync
container: node18
steps:
- checkout: self
- script: |
TAG_NAME=$(Build.SourceBranchName)
BRANCH_NAME=$(echo $TAG_NAME | sed 's/^refs\/tags\///' | sed 's/\./_/g')
git config --global user.email "jigar.dafda@gmail.com"
git config --global user.name "Jigar Dafda"
git clone https://$(GITHUB_USERNAME):$(GITHUB_PERSONAL_TOKEN)@github.com/gofynd/fdk-store.git
cd fdk-store
git checkout -b $BRANCH_NAME
rm -rf ./*
cd ..
cp -R `ls | grep -v "fdk-store"` ./fdk-store
cp .gitignore.ci ./fdk-store/.gitignore
cd fdk-store
NODE_ENV=development npm i
npm run build
npm run doc
git add .
git commit -m "[Auto Generated]"
git push origin $BRANCH_NAME
git tag $TAG_NAME
git push origin $TAG_NAME
if [[ "$TAG_NAME" == v2* ]]; then
echo "Tag starts with v2. Pushing to master branch..."
git checkout master
git pull origin master
git merge $BRANCH_NAME
git push origin master
else
echo "Tag does not start with v2. Skipping push to master branch..."
fi
displayName: 'Sync with GitHub'