Skip to content

Commit

Permalink
Finalise deployment
Browse files Browse the repository at this point in the history
Launch post-deploy script

Fix deployment script
  • Loading branch information
odolbeau committed Dec 13, 2023
1 parent dcb05ca commit da661fb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,17 @@ jobs:
uses: easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
ARGS: "-rlgoDzvcC -i --delete-after --delete-excluded"
ARGS: "-rlgoDzvcC -i --delete --chown=admin:www-data"
SOURCE: "/"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: ${{ secrets.REMOTE_TARGET }}
EXCLUDE: "/migrations/, /var/, /.github/, /tests/, /tools/"
EXCLUDE: "/var/, /.github/, /tests/, /tools/, .env"

- name: Execute remote ssh commands to finalise deployment
uses: appleboy/[email protected]
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: ${{ secrets.DOCKER_COMPOSE_EXEC_COMMAND }} bin/post-deploy
8 changes: 8 additions & 0 deletions bin/post-deploy
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -e

bin/console cache:clear
bin/console doctrine:migrations:migrate --no-interaction
whoami
composer dump-env prod

0 comments on commit da661fb

Please sign in to comment.