This commit is contained in:
@@ -16,7 +16,7 @@ jobs:
|
|||||||
- name: Install tools
|
- name: Install tools
|
||||||
run: |
|
run: |
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y docker.io openssh-client
|
apt-get install -y docker.io openssh-client rsync
|
||||||
|
|
||||||
- name: Login to registry
|
- name: Login to registry
|
||||||
env:
|
env:
|
||||||
@@ -44,7 +44,7 @@ jobs:
|
|||||||
chmod 600 ~/.ssh/id_ed25519
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
ssh-keyscan -H alpha.mintel.me >> ~/.ssh/known_hosts
|
ssh-keyscan -H alpha.mintel.me >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
- name: Sync docker-compose file to server
|
- name: Sync files to server
|
||||||
run: |
|
run: |
|
||||||
echo "Checking for docker-compose file..."
|
echo "Checking for docker-compose file..."
|
||||||
|
|
||||||
@@ -60,42 +60,26 @@ jobs:
|
|||||||
|
|
||||||
echo "Found and syncing: $COMPOSE_FILE"
|
echo "Found and syncing: $COMPOSE_FILE"
|
||||||
|
|
||||||
# Verzeichnis vorbereiten
|
COMMON_SSH_OPTS="-o StrictHostKeyChecking=no -o ServerAliveInterval=30 -o ServerAliveCountMax=6 -o TCPKeepAlive=yes -o ConnectTimeout=30"
|
||||||
ssh -i ~/.ssh/id_ed25519 \
|
|
||||||
-o StrictHostKeyChecking=no \
|
ssh -i ~/.ssh/id_ed25519 $COMMON_SSH_OPTS deploy@alpha.mintel.me \
|
||||||
-o ServerAliveInterval=60 \
|
|
||||||
-o ServerAliveCountMax=5 \
|
|
||||||
-o TCPKeepAlive=yes \
|
|
||||||
deploy@alpha.mintel.me \
|
|
||||||
"mkdir -p /home/deploy/sites/klz-cables.com && chmod 775 /home/deploy/sites/klz-cables.com"
|
"mkdir -p /home/deploy/sites/klz-cables.com && chmod 775 /home/deploy/sites/klz-cables.com"
|
||||||
|
|
||||||
# Datei kopieren mit KeepAlive
|
# rsync für Compose-Datei
|
||||||
scp -i ~/.ssh/id_ed25519 \
|
rsync -avz --progress \
|
||||||
-o StrictHostKeyChecking=no \
|
-e "ssh -i ~/.ssh/id_ed25519 $COMMON_SSH_OPTS" \
|
||||||
-o ServerAliveInterval=60 \
|
"$COMPOSE_FILE" deploy@alpha.mintel.me:/home/deploy/sites/klz-cables.com/"$COMPOSE_FILE"
|
||||||
-o ServerAliveCountMax=5 \
|
|
||||||
-o TCPKeepAlive=yes \
|
|
||||||
"$COMPOSE_FILE" \
|
|
||||||
deploy@alpha.mintel.me:/home/deploy/sites/klz-cables.com/"$COMPOSE_FILE"
|
|
||||||
|
|
||||||
# varnish optional
|
# varnish optional
|
||||||
if [ -d "./varnish" ]; then
|
if [ -d "./varnish" ]; then
|
||||||
scp -r -i ~/.ssh/id_ed25519 \
|
rsync -avz --progress \
|
||||||
-o StrictHostKeyChecking=no \
|
-e "ssh -i ~/.ssh/id_ed25519 $COMMON_SSH_OPTS" \
|
||||||
-o ServerAliveInterval=60 \
|
|
||||||
-o ServerAliveCountMax=5 \
|
|
||||||
-o TCPKeepAlive=yes \
|
|
||||||
varnish/ deploy@alpha.mintel.me:/home/deploy/sites/klz-cables.com/
|
varnish/ deploy@alpha.mintel.me:/home/deploy/sites/klz-cables.com/
|
||||||
echo "varnish synced"
|
echo "varnish synced"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Rechte + Log-Nachweis
|
# Rechte + Log
|
||||||
ssh -i ~/.ssh/id_ed25519 \
|
ssh -i ~/.ssh/id_ed25519 $COMMON_SSH_OPTS deploy@alpha.mintel.me \
|
||||||
-o StrictHostKeyChecking=no \
|
|
||||||
-o ServerAliveInterval=60 \
|
|
||||||
-o ServerAliveCountMax=5 \
|
|
||||||
-o TCPKeepAlive=yes \
|
|
||||||
deploy@alpha.mintel.me \
|
|
||||||
"chmod 664 /home/deploy/sites/klz-cables.com/$COMPOSE_FILE && \
|
"chmod 664 /home/deploy/sites/klz-cables.com/$COMPOSE_FILE && \
|
||||||
ls -la /home/deploy/sites/klz-cables.com/ && \
|
ls -la /home/deploy/sites/klz-cables.com/ && \
|
||||||
stat /home/deploy/sites/klz-cables.com/$COMPOSE_FILE && \
|
stat /home/deploy/sites/klz-cables.com/$COMPOSE_FILE && \
|
||||||
@@ -106,12 +90,9 @@ jobs:
|
|||||||
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
|
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
|
||||||
REGISTRY_PASS: ${{ secrets.REGISTRY_PASS }}
|
REGISTRY_PASS: ${{ secrets.REGISTRY_PASS }}
|
||||||
run: |
|
run: |
|
||||||
ssh -i ~/.ssh/id_ed25519 \
|
COMMON_SSH_OPTS="-o StrictHostKeyChecking=no -o ServerAliveInterval=30 -o ServerAliveCountMax=6 -o TCPKeepAlive=yes -o ConnectTimeout=30 -o IPQoS=0x00"
|
||||||
-o StrictHostKeyChecking=no \
|
|
||||||
-o ServerAliveInterval=60 \
|
ssh -i ~/.ssh/id_ed25519 $COMMON_SSH_OPTS deploy@alpha.mintel.me "
|
||||||
-o ServerAliveCountMax=5 \
|
|
||||||
-o TCPKeepAlive=yes \
|
|
||||||
-o IPQoS=0x00 deploy@alpha.mintel.me "
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo 'Logging in to registry...'
|
echo 'Logging in to registry...'
|
||||||
|
|||||||
Reference in New Issue
Block a user