-
Notifications
You must be signed in to change notification settings - Fork 58
46 lines (46 loc) · 2.17 KB
/
dev-push.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
name: update-code-push
on: [push]
jobs:
push-step-1:
runs-on: self-hosted
steps:
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.HUBADMIN_KEY }}
if_key_exists: replace ### replace|ignore|fail; optional (defaults to fail)
known_hosts: |
${{ secrets.KNOWN_HOSTS_DEV_PURR_PURDUE_EDU }}
${{ secrets.KNOWN_HOSTS_STAGE_CMKC_HUBZERO_ORG }}
# - name: dev push to stage.cmkc.hubzero.org
# run: |
# echo "Checking if 'freeze' file exists and conditionally stashing and pulling"
# ssh [email protected] "
# if [ ! -f /var/www/stage/freeze ]; then
# echo 'No freeze file found. Proceeding with stash and pull.'
# echo \"$(date) - No freeze file found. Stashing and pulling.\" >> /var/www/stage/deployments.log
# cd /var/www/stage/;
# git stash -u >> /var/www/stage/deployments.log 2>&1;
# git pull >> /var/www/stage/deployments.log 2>&1;
# echo \"$(date) - Stash and pull completed.\" >> /var/www/stage/deployments.log
# else
# echo 'Freeze file exists. Skipping stash and pull.'
# echo \"$(date) - Freeze file exists. Stash and pull skipped.\" >> /var/www/stage/deployments.log
# fi
# "
- name: dev push to dev.purr.purdue.edu
run: |
echo "Checking if 'freeze' file exists and conditionally stashing and pulling"
ssh StrictHostKeyChecking=no [email protected] "
if [ ! -f /var/www/dev/freeze ]; then
echo 'No freeze file found. Proceeding with stash and pull.'
echo \"$(date) - No freeze file found. Stashing and pulling.\" >> /var/www/dev/deployments.log
cd /var/www/dev/;
git stash -u >> /var/www/dev/deployments.log 2>&1;
git pull >> /var/www/dev/deployments.log 2>&1;
echo \"$(date) - Stash and pull completed.\" >> /var/www/dev/deployments.log
else
echo 'Freeze file exists. Skipping stash and pull.'
echo \"$(date) - Freeze file exists. Stash and pull skipped.\" >> /var/www/dev/deployments.log
fi
"