Skip to content

Commit

Permalink
another attempt at ssh connection
Browse files Browse the repository at this point in the history
  • Loading branch information
hepplerj authored Nov 21, 2024
1 parent 05d7ff6 commit 6134b5f
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions .github/workflows/hugo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,25 @@ jobs:
asset_name: site.tar.gz
asset_content_type: application/gzip

- name: Deploy to server
uses: burnett01/[email protected]
with:
switches: -avz --delete --exclude-from=rsync-excludes --omit-dir-times --checksum --itemize-changes
path: public/
remote_path: ~/public_html/
remote_host: ${{ secrets.SERVER_HOST }}
remote_user: ${{ secrets.SERVER_USER }}
remote_key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Setup SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
echo "Host ${{ secrets.SERVER_HOST }}
HostName ${{ secrets.SERVER_HOST }}
User ${{ secrets.SERVER_USER }}
IdentityFile ~/.ssh/deploy_key
IdentitiesOnly yes
StrictHostKeyChecking no" > ~/.ssh/config
- name: Deploy with rsync
run: |
rsync --omit-dir-times --checksum -avz --itemize-changes \
public/ ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }}:~/public_html/ | egrep -v '^\.'
- name: Show changed files
run: |
ssh ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }} \
"find ~/public_html -type f -mtime -1 -ls | egrep -v '^\\.'"

0 comments on commit 6134b5f

Please sign in to comment.