Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

Commit

Permalink
Update workflow to use rclone deploy
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel F. Dickinson <[email protected]>
  • Loading branch information
danielfdickinson committed Aug 9, 2022
1 parent 052252e commit 667d394
Showing 1 changed file with 25 additions and 10 deletions.
35 changes: 25 additions & 10 deletions .github/workflows/build-and-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
- build-minified-site
- validate-unminified-html
- check-links
environment: minimal-test-production
environment: production
runs-on: ubuntu-20.04
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
steps:
Expand All @@ -94,12 +94,27 @@ jobs:
env:
DOWNLOAD_SITE_FILENAME: hugo-site.tar
run: tar -xf "${DOWNLOAD_SITE_FILENAME}"
- name: "Deploy Minified Site"
uses: wlixcc/[email protected]
with:
local_path: './public/*'
port: ${{ secrets.DEPLOY_SFTP_PORT }}
server: ${{ secrets.DEPLOY_SFTP_HOSTNAME }}
ssh_private_key: ${{ secrets.DEPLOY_PRIVATE_KEY }}
remote_path: ${{ secrets.DEPLOY_SFTP_REMOTE_PATH }}
username: ${{ secrets.DEPLOY_SFTP_USERNAME }}
- name: "Install Rclone"
run: |
sudo apt-get update
sudo apt-get install rclone
- name: "Deploy minified site (rclone sync)"
shell: bash
env:
RCLONE_ONE_FILE_SYSTEM: "true"
RCLONE_ERROR_ON_NO_TRANSFER: "true"
RCLONE_SFTP_SKIP_LINKS: "true"
RCLONE_SFTP_KEY_FILE_PASS: "${{ secrets.DEPLOY_SFTP_KEY_PASS }}"
RCLONE_SFTP_PORT: ${{ secrets.DEPLOY_SFTP_PORT }}
RCLONE_SFTP_HOST: ${{ secrets.DEPLOY_SFTP_HOSTNAME }}
SFTP_KEY_PEM: "${{ secrets.DEPLOY_SFTP_PRIVATE_KEY }}"
REMOTE_PATH: "${{ secrets.DEPLOY_SFTP_REMOTE_PATH }}"
RCLONE_SFTP_USER: ${{ secrets.DEPLOY_SFTP_USERNAME }}
run: |
eval "$(ssh-agent)"
umask 177
echo "${SFTP_KEY_PEM}" >~/sftp-key-file
umask 0022
export RCLONE_SFTP_KEY_FILE=~/sftp-key-file
export RCLONE_ONE_FILE_SYSTEM RCLONE_ERROR_ON_NO_TRANSFER RCLONE_SFTP_SKIP_LINKS RCLONE_SFTP_KEY_FILE_PASS RCLONE_SFTP_PORT RCLONE_SFTP_HOST REMOTE_PATH RCLONE_SFTP_USER
rclone sync public/ :sftp:${REMOTE_PATH}

0 comments on commit 667d394

Please sign in to comment.