Skip to content

Commit

Permalink
use ssh-exec action in the workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
atas committed Oct 16, 2024
1 parent 195ccb4 commit 2b8f188
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,18 @@ jobs:
--notes "$COMMIT_MSG"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

deploy:
runs-on: ubuntu-latest
needs: release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
environment: demo
steps:
- name: Set up SSH
run: |
mkdir -p ~/.ssh/
ls -lha ~/.ssh
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -p ${{ secrets.SSH_PORT }} ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
- name: Trigger pull-deploy
run: |
ssh -p${{ secrets.SSH_PORT }} ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "/opt/swipetor/bin/pull-deploy/run.sh"
- name: Use SSH Deploy Action
uses: atas/actions/[email protected]
with:
ssh_key: ${{ secrets.SSH_KEY }}
ssh_port: ${{ secrets.SSH_PORT }}
ssh_host: ${{ secrets.SSH_HOST }}
ssh_user: ${{ secrets.SSH_USER }}
deploy_script_path: "/opt/swipetor/bin/pull-deploy/run.sh"

0 comments on commit 2b8f188

Please sign in to comment.