Skip to content

Commit

Permalink
Added SCRIPT_PATH environment variable to make the action more portable
Browse files Browse the repository at this point in the history
  • Loading branch information
onecrayon committed Jan 21, 2024
1 parent 9d5c067 commit c7279a6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: ci
env:
SCRIPT_PATH: ${{ secrets.SCRIPT_PATH }}
steps:
- name: Configure SSH
run: |
Expand All @@ -82,11 +84,11 @@ jobs:
SSH_KEY: ${{ secrets.SSH_KEY }}
SSH_HOST: ${{ secrets.SSH_HOST }}
- name: Stop the server
run: ssh deploy-server 'cd ~/apps/api_ashes_live && ./stop'
run: ssh deploy-server 'cd "$SCRIPT_PATH" && ./stop'
- name: Check out source
run: ssh deploy-server 'cd ~/apps/api_ashes_live/api.ashes.live && git fetch && git reset --hard origin/main'
run: ssh deploy-server 'cd "${SCRIPT_PATH}/api.ashes.live" && git fetch && git reset --hard origin/main'
- name: Update dependencies & run migrations
run: ssh deploy-server 'cd ~/apps/api_ashes_live && ./update'
run: ssh deploy-server 'cd "$SCRIPT_PATH" && ./update'
- name: Start the server
if: ${{ always() }}
run: ssh deploy-server '~/apps/api_ashes_live && ./start'
run: ssh deploy-server 'cd "$SCRIPT_PATH" && ./start'

0 comments on commit c7279a6

Please sign in to comment.