easingthemes / ssh-deploy

GitHub Action for deploying code via rsync over ssh. (with NodeJS)
MIT License
1.19k stars 146 forks source link

Env variables in the SCRIPT_BEFORE and SCRIPT_AFTER scripts #130

Closed altrusl closed 1 year ago

altrusl commented 1 year ago

Hello

Thank you for the good software

Is there any way to use env variables (from jobs->deploy->env section) in the scripts?

I have to surround your action with appleboy/ssh-action@master to use them

mrl22 commented 1 year ago

I have this same issue. I am trying to build a similar feature to Capistrano but I am unable to use ${GITHUB_SHA::6}

SCRIPT_AFTER: |
            cd ./releases/
            pwd
            ls -t | awk 'NR>5' | xargs -L1 rm -rf # Keep only the latest 5 commits for rolling back
            cd ${GITHUB_SHA::6}
            pwd
            mkdir ../../storage
            ln -s storage ../../storage
            php artisan storage:link
            pwd
            ln -s ./ ../../public_html 
            echo $RSYNC_STDOUT

@altrusl do you have an example of how you are doing it with ssh-action?

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

davidavz commented 1 year ago

Any news ?

hokoo commented 12 months ago

The same issue