From 4e11bc9d54a733c655beeb1f19d48c32a268c5dc Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Tue, 23 Jun 2026 18:04:26 +0100 Subject: [PATCH] SFTP the documentation to the website on push to master (#1468) * Workflow for deploying documentation * Workflow for deploying documentation * Workflow for deploying documentation * Workflow for deploying documentation * Workflow for deploying documentation * Workflow for deploying documentation * Workflow for deploying documentation * Workflow for deploying documentation * Workflow for deploying documentation * Workflow for deploying documentation * Workflow for deploying documentation * Workflow for deploying documentation * Workflow for deploying documentation * Workflow for deploying documentation * Removed mention of 'SCP' * Added final newline * Removed old script * Test alternative 'copy docs to website' job. * Updated to burnett01/rsync-deployments@8.0.5 as 7.0.2 is deprecated * Removed test branch from the 'push' list --------- Co-authored-by: John Wellbelove --- .../workflows/deploy-etl-documentation.yml | 44 +++++++++++++++++++ .github/workflows/deploy_documentation.yml | 39 ---------------- scripts/deploy_documentation.sh | 16 ------- 3 files changed, 44 insertions(+), 55 deletions(-) create mode 100644 .github/workflows/deploy-etl-documentation.yml delete mode 100644 .github/workflows/deploy_documentation.yml delete mode 100755 scripts/deploy_documentation.sh diff --git a/.github/workflows/deploy-etl-documentation.yml b/.github/workflows/deploy-etl-documentation.yml new file mode 100644 index 00000000..b7636de1 --- /dev/null +++ b/.github/workflows/deploy-etl-documentation.yml @@ -0,0 +1,44 @@ +name: Deploy documentation via SFTP + +on: + push: + branches: [ master ] + +jobs: + deploy: + runs-on: ubuntu-latest + + defaults: + run: + working-directory: ./hugo + + steps: + # Check out the repository code + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 0 + + # Install and set up Hugo + - name: Setup Hugo + uses: peaceiris/actions-hugo@v3 + with: + hugo-version: 'latest' + extended: true + + # Build the static site + - name: Build Hugo Site + run: hugo --cleanDestinationDir --minify --baseURL "https://www.etlcpp.com/" + + # Upload the files via rsync. + - name: Deploy via rsync + uses: burnett01/rsync-deployments@8.0.5 + with: + switches: -avzr --delete + path: hugo/public/ + remote_path: ${{ secrets.DOCS_DEST_DIR }} + remote_host: ${{ secrets.DOCS_SSH_SERVER }} + remote_port: ${{ secrets.DOCS_SSH_PORT }} + remote_user: ${{ secrets.DOCS_SSH_USER }} + remote_key: ${{ secrets.DOCS_DEPLOY_KEY }} diff --git a/.github/workflows/deploy_documentation.yml b/.github/workflows/deploy_documentation.yml deleted file mode 100644 index fb300580..00000000 --- a/.github/workflows/deploy_documentation.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Deploy documentation to www.etlcpp.com - -on: - push: - branches: - - master - - workflow_dispatch: - -jobs: - build_deploy: - name: build and deploy - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 0 - - - name: Setup Hugo - uses: peaceiris/actions-hugo@v3 - with: - hugo-version: '0.147.1' - extended: true - - - name: Build - working-directory: hugo - run: hugo --minify --cleanDestinationDir --baseURL "https://www.etlcpp.com/" - - # Deploys the site via the deploy script in the ci directory - - name: Deploy - run: source $GITHUB_WORKSPACE/scripts/deploy_documentation.sh - env: - ACTIONS_DEPLOY_KEY: ${{ secrets.DOCS_BDEPLOY_KEY }} - SSH_USERNAME: ${{ secrets.DOCS_SSH_USER }} - SERVER_ADDRESS: ${{ secrets.DOCS_SSH_SERVER }} - SERVER_DESTINATION: ${{ secrets.DOCS_DEST_DIR }} - SSH_PORT: ${{ secrets.DOCS_SSH_PORT }} diff --git a/scripts/deploy_documentation.sh b/scripts/deploy_documentation.sh deleted file mode 100755 index a29c84b6..00000000 --- a/scripts/deploy_documentation.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -set -e - -# Set up SSH -mkdir -p ~/.ssh -echo "$ACTIONS_DEPLOY_KEY" > ~/.ssh/deploy_key -chmod 600 ~/.ssh/deploy_key - -# Add server to known hosts -ssh-keyscan -p "$SSH_PORT" "$SERVER_ADDRESS" >> ~/.ssh/known_hosts - -# Deploy using rsync over SSH -rsync -avz --delete \ - -e "ssh -i ~/.ssh/deploy_key -p $SSH_PORT" \ - hugo/public/ \ - "$SSH_USERNAME@$SERVER_ADDRESS:$SERVER_DESTINATION" \ No newline at end of file