-
Notifications
You must be signed in to change notification settings - Fork 0
/
.build.yml
executable file
·37 lines (31 loc) · 1.07 KB
/
.build.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
image: debian/stable
sources:
- https://git.sr.ht/~retzoh/bash_functions
environment:
REPOSITORY_NAME: bash_functions
PACKAGE_NAME: bash_functions
PACKAGE_FOLDER: bash_functions
PACKAGE_PATH: .
GIT_SR_HT_URL: [email protected]:~retzoh/bash_functions
GITHUB_URL: [email protected]:Retzoh/bash_functions.git
secrets:
- ed37ce69-d5be-42df-9b92-41471089d431 # ~/.ssh/known_hosts
- 899472e5-1ec8-4211-a00b-05a0d3eaf775 # ~/.ssh/.github_deploy_ssh_key
tasks:
- deploy_master: |
ln -sf ~/.ssh/.build_test_ssh_key ~/.ssh/id_rsa
cd "$REPOSITORY_NAME"
git remote set-url origin $GIT_SR_HT_URL
lines=`git diff --stat origin/master..HEAD | wc -l`
if [ $lines -eq 0 ]
then
# deploy code
git config --global user.email "~retzoh/[email protected]"
git config --global user.name "Deploy"
ln -sf ~/.ssh/.github_deploy_ssh_key ~/.ssh/id_rsa
git checkout -B master -t origin/master
git remote set-url origin $GITHUB_URL
git push --set-upstream origin master
else
echo "Aborting github deployment: HEAD is dirty compared to master."
fi