forked from cosmoway/yokoshiki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
48 lines (46 loc) · 1.36 KB
/
.gitlab-ci.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
pages:
stage: deploy
script:
- mkdir .public
- cp -r * .public
- mv .public public
artifacts:
paths:
- public
only:
- develop
staging:
stage: deploy
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- which rsync || ( apt-get update -y && apt-get install rsync -y )
script:
- rsync -auz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --delete --exclude=".git" --exclude=".gitlab-ci.yml" --exclude="README.md" ./* [email protected]:/var/www/yokoshiki-blocks/
only:
- master
production:
stage: deploy
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY2" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- which git || ( apt-get update -y && apt-get install git -y )
script:
- rm -rf .git
- git init
- git config --global user.email $GITHUB_USER_EMAIL
- git config --global user.name "$GITHUB_USER_NAME"
- git remote add origin $GITHUB_REPOSITORY_URL
- git fetch
- git reset origin/master
- git add .
- git commit -m "commit for deployment"
- git push origin master
only:
- master-yokoshiki