Skip to content

Commit

Permalink
Fix docker dev deployment to onprem (#572)
Browse files Browse the repository at this point in the history
  • Loading branch information
beezybarg authored Jul 10, 2024
1 parent 7395676 commit 7281ea3
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
name: Deploy Dev

on:
push:
workflow_run:
workflows: ["Docker Build"]
branches: [dev]
types:
- completed
jobs:
deploy:
runs-on: ubuntu-latest
needs: build-docker
deploy-docker-dev:
runs-on: self-hosted
steps:
- name: Configure SSH
- name: Configure ssh & Deploy
shell: bash
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/deployer.key
chmod 600 ~/.ssh/deployer.key
echo "$SSH_KEY" | base64 -d > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
echo "$DEPLOYMENT_TARGETS"
for h in $DEPLOYMENT_TARGETS; do echo Deploying to $h && \
ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no $SSH_USER@$h \
timeout 30 ssh $SSH_FLAGS $SSH_USER@$h \
'cd /opt/next-app-dev && docker compose pull && docker compose up -d' ; done
env:
SSH_USER: ${{ secrets.DEPLOYER_SSH_USER }}
SSH_KEY: ${{ secrets.DEPLOYER_SSH_KEY }}
SSH_FLAGS: ${{ secrets.DEPLOYER_SSH_FLAGS }}
DEPLOYMENT_TARGETS: ${{ secrets.DEV_DOCKER_DEPLOYMENT_TARGETS }}

0 comments on commit 7281ea3

Please sign in to comment.