Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
code28 committed Jun 26, 2024
1 parent a292573 commit 851546f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
User $SSH_USER
IdentityFile ~/.ssh/sshkey.key
StrictHostKeyChecking no
SendEnv TARGET_DIR
END
env:
SSH_USER: ${{ inputs.production == true && secrets.PRODUCTION_SSH_USER || secrets.STAGING_SSH_USER }}
Expand All @@ -39,8 +40,9 @@ jobs:

- name: Run deploy commands on remote server
run: |
ssh sshhost 'echo "target dir: $TARGET_DIR"'
ssh sshhost 'cd "$TARGET_DIR" && pwd'
ssh sshhost 'echo "target dir 1: $TARGET_DIR"'
ssh sshhost TARGET_DIR=$TARGET_DIR 'echo "target dir 2: $TARGET_DIR"'
ssh sshhost TARGET_DIR=$TARGET_DIR 'cd "$TARGET_DIR" && pwd'
ssh sshhost 'cd $TARGET_DIR && git fetch && git checkout main && git pull && bash check_env.sh && docker compose up -d --no-deps --build backend'
ssh sshhost 'df . | awk "NR==2{if(\$4<=20*1024*1024) { system(\"docker system prune -f\") } else { system(\"echo \\\"Enough space left. No need to prune docker.\\\"\") } }"'
env:
Expand Down

0 comments on commit 851546f

Please sign in to comment.