This repository has been archived by the owner on Dec 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update workflow to use rclone deploy
Signed-off-by: Daniel F. Dickinson <[email protected]>
- Loading branch information
1 parent
052252e
commit 667d394
Showing
1 changed file
with
25 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -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} |