From a8fac6aab7778022319aa58a5116e2afaa4bfd5a Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 22 Jul 2025 17:21:41 -0400 Subject: [PATCH 01/13] Dropping PR merge and deployment step while tshooting rsync. --- .gitea/workflows/hugo_site_deployment.yml | 169 +++++++++++----------- 1 file changed, 84 insertions(+), 85 deletions(-) diff --git a/.gitea/workflows/hugo_site_deployment.yml b/.gitea/workflows/hugo_site_deployment.yml index 0534760..ad93057 100644 --- a/.gitea/workflows/hugo_site_deployment.yml +++ b/.gitea/workflows/hugo_site_deployment.yml @@ -104,61 +104,11 @@ jobs: gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}' notification_title: 'GITEA: Hugo' notification_message: 'Broken link inspection done... 🔍' - pr-merge: - name: PR Merge - needs: [hugo-sanity-check] - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Cache tea CLI - id: cache-tea - uses: actions/cache@v4 - with: - path: /opt/hostedtoolcache/tea/${{ env.TEA_VERSION }}/x64 - key: tea-${{ runner.os }}-${{ env.TEA_VERSION }} - - name: Install tea - uses: supplypike/setup-bin@v4 - with: - uri: https://gitea.com/gitea/tea/releases/download/v${{ env.TEA_VERSION }}/tea-${{ env.TEA_VERSION }}-linux-amd64 - name: tea - version: ${{ env.TEA_VERSION }} - - name: PR Merge - id: pr_merge - run: | - tea login add --name gitea-rinoa --url ${{ secrets.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} - tea login default gitea-rinoa - echo "Merging PR..." - pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --fields index,title,head,state --output csv | egrep ${{ github.ref_name }} | awk -F"," '{print $1}' | sed -e 's|"||g') - tea pr m --repo ${{ github.repository }} --title "Auto Merge of PR ${pr_index} - ${{ github.ref_name }}" --message "Merged by ${{ github.actor }}" ${pr_index} - echo "pr_index=${pr_index}" >> $GITHUB_OUTPUT - - name: Gotify Notification - uses: eikendev/gotify-action@master - with: - gotify_api_base: '${{ secrets.RINOA_GOTIFY_URL }}' - gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}' - notification_title: 'GITEA: PR Merge Successful' - notification_message: 'PR #${{ steps.pr_mesubrge.outputs.pr_index }} merged.' - deploy-hugo-site: - name: Build and Deploy to Server - needs: [hugo-sanity-check, pr-merge] - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - with: - submodules: true - - name: Setup Hugo - uses: peaceiris/actions-hugo@v3 - with: - hugo-version: "latest" - extended: true - name: Setup rsync id: setup-rsync uses: GuillaumeFalourd/setup-rsync@v1.2 with: - ssh-key: | - ${{ secrets.VPS_DEPLOY_KEY }} + ssh-key: ${{ secrets.VPS_DEPLOY_KEY }} - name: Verifying key path run: echo "SSK KEY PATH ${{ steps.setup-rsync.outputs.ssh_key_path }}" - name: Testing rsync @@ -170,37 +120,86 @@ jobs: ${{ secrets.VPS_DEPLOY_KEY }} run: | rsync -e 'ssh -o StrictHostKeyChecking=no' -avz --progress --dry-run README.md charish@${VPS_DEPLOY_HOST}:${VPS_DEPLOY_DEST} - - name: Gotify Notification - uses: eikendev/gotify-action@master - with: - gotify_api_base: '${{ secrets.RINOA_GOTIFY_URL }}' - gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}' - notification_title: 'GITEA: Hugo' - notification_message: 'Starting Hugo deployment... 🤞🏽' - - name: Generate Hugo Site & Deploy for Docker - env: - VPS_DEPLOY_USER: ${{ secrets.HUGO_DEPLOY_USERNAME }} - VPS_DEPLOY_HOST: ${{ secrets.HUGO_SITE_HOST }} - VPS_DEPLOY_DEST: ${{ secrets.VPS_DEPLOY_DEST }} - VPS_DEPLOY_KEY: | - $$ {{ secrets.VPS_DEPLOY_KEY }} - run: | - hugo version - hugo --minify --source . - rsync --progress -avz -e 'ssh -o StrictHostKeyChecking=no' ./public ${VPS_DEPLOY_USER}@${VPS_DEPLOY_HOST}:${VPS_DEPLOY_DEST} - - name: Restart Hugo Container - uses: appleboy/ssh-action@v1.2.2 - with: - host: ${{ secrets.HUGO_SITE_HOST }} - username: ${{ secrets.HUGO_DEPLOY_USERNAME }} - password: ${{ secrets.HUGO_DEPLOY_PASSWORD }} - key: ${{ secrets.VPS_DEPLOY_KEY }} - script: | - docker container restart hugo - - name: Gotify Notification - uses: eikendev/gotify-action@master - with: - gotify_api_base: '${{ secrets.RINOA_GOTIFY_URL }}' - gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}' - notification_title: 'GITEA: Hugo' - notification_message: 'Hugo deployment successful!' \ No newline at end of file + # pr-merge: + # name: PR Merge + # needs: [hugo-sanity-check] + # runs-on: ubuntu-latest + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + # - name: Cache tea CLI + # id: cache-tea + # uses: actions/cache@v4 + # with: + # path: /opt/hostedtoolcache/tea/${{ env.TEA_VERSION }}/x64 + # key: tea-${{ runner.os }}-${{ env.TEA_VERSION }} + # - name: Install tea + # uses: supplypike/setup-bin@v4 + # with: + # uri: https://gitea.com/gitea/tea/releases/download/v${{ env.TEA_VERSION }}/tea-${{ env.TEA_VERSION }}-linux-amd64 + # name: tea + # version: ${{ env.TEA_VERSION }} + # - name: PR Merge + # id: pr_merge + # run: | + # tea login add --name gitea-rinoa --url ${{ secrets.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} + # tea login default gitea-rinoa + # echo "Merging PR..." + # pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --fields index,title,head,state --output csv | egrep ${{ github.ref_name }} | awk -F"," '{print $1}' | sed -e 's|"||g') + # tea pr m --repo ${{ github.repository }} --title "Auto Merge of PR ${pr_index} - ${{ github.ref_name }}" --message "Merged by ${{ github.actor }}" ${pr_index} + # echo "pr_index=${pr_index}" >> $GITHUB_OUTPUT + # - name: Gotify Notification + # uses: eikendev/gotify-action@master + # with: + # gotify_api_base: '${{ secrets.RINOA_GOTIFY_URL }}' + # gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}' + # notification_title: 'GITEA: PR Merge Successful' + # notification_message: 'PR #${{ steps.pr_mesubrge.outputs.pr_index }} merged.' + # deploy-hugo-site: + # name: Build and Deploy to Server + # needs: [hugo-sanity-check, pr-merge] + # runs-on: ubuntu-latest + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v4 + # with: + # submodules: true + # - name: Setup Hugo + # uses: peaceiris/actions-hugo@v3 + # with: + # hugo-version: "latest" + # extended: true + # - name: Gotify Notification + # uses: eikendev/gotify-action@master + # with: + # gotify_api_base: '${{ secrets.RINOA_GOTIFY_URL }}' + # gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}' + # notification_title: 'GITEA: Hugo' + # notification_message: 'Starting Hugo deployment... 🤞🏽' + # - name: Generate Hugo Site & Deploy for Docker + # env: + # VPS_DEPLOY_USER: ${{ secrets.HUGO_DEPLOY_USERNAME }} + # VPS_DEPLOY_HOST: ${{ secrets.HUGO_SITE_HOST }} + # VPS_DEPLOY_DEST: ${{ secrets.VPS_DEPLOY_DEST }} + # VPS_DEPLOY_KEY: | + # $$ {{ secrets.VPS_DEPLOY_KEY }} + # run: | + # hugo version + # hugo --minify --source . + # rsync --progress -avz -e 'ssh -o StrictHostKeyChecking=no' ./public ${VPS_DEPLOY_USER}@${VPS_DEPLOY_HOST}:${VPS_DEPLOY_DEST} + # - name: Restart Hugo Container + # uses: appleboy/ssh-action@v1.2.2 + # with: + # host: ${{ secrets.HUGO_SITE_HOST }} + # username: ${{ secrets.HUGO_DEPLOY_USERNAME }} + # password: ${{ secrets.HUGO_DEPLOY_PASSWORD }} + # key: ${{ secrets.VPS_DEPLOY_KEY }} + # script: | + # docker container restart hugo + # - name: Gotify Notification + # uses: eikendev/gotify-action@master + # with: + # gotify_api_base: '${{ secrets.RINOA_GOTIFY_URL }}' + # gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}' + # notification_title: 'GITEA: Hugo' + # notification_message: 'Hugo deployment successful!' \ No newline at end of file From 52590776f710f3995c81764c2604fb9cf67f114b Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 22 Jul 2025 17:29:10 -0400 Subject: [PATCH 02/13] Tshooting rsync. --- .gitea/workflows/hugo_site_deployment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/hugo_site_deployment.yml b/.gitea/workflows/hugo_site_deployment.yml index ad93057..264000e 100644 --- a/.gitea/workflows/hugo_site_deployment.yml +++ b/.gitea/workflows/hugo_site_deployment.yml @@ -104,6 +104,7 @@ jobs: gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}' notification_title: 'GITEA: Hugo' notification_message: 'Broken link inspection done... 🔍' + - run: echo "${{ secrets.VPS_DEPLOY_KEY }}" - name: Setup rsync id: setup-rsync uses: GuillaumeFalourd/setup-rsync@v1.2 From 72f8fba825fbbc4d348497ec7d5b97c6d60a57e0 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 22 Jul 2025 17:34:35 -0400 Subject: [PATCH 03/13] Tshooting rsync #3. --- .gitea/workflows/hugo_site_deployment.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/hugo_site_deployment.yml b/.gitea/workflows/hugo_site_deployment.yml index 264000e..716d24d 100644 --- a/.gitea/workflows/hugo_site_deployment.yml +++ b/.gitea/workflows/hugo_site_deployment.yml @@ -104,14 +104,14 @@ jobs: gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}' notification_title: 'GITEA: Hugo' notification_message: 'Broken link inspection done... 🔍' - - run: echo "${{ secrets.VPS_DEPLOY_KEY }}" - name: Setup rsync - id: setup-rsync + id: rsync uses: GuillaumeFalourd/setup-rsync@v1.2 with: ssh-key: ${{ secrets.VPS_DEPLOY_KEY }} - name: Verifying key path - run: echo "SSK KEY PATH ${{ steps.setup-rsync.outputs.ssh_key_path }}" + run: | + echo "SSK KEY PATH: ${{ steps.rsync.outputs.ssh_key_path }}" - name: Testing rsync env: VPS_DEPLOY_USER: ${{ secrets.HUGO_DEPLOY_USERNAME }} From 5f8e884ce4af8d06ed232492330604353360c1c1 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 22 Jul 2025 17:36:50 -0400 Subject: [PATCH 04/13] Tshooting rsync #3. --- .gitea/workflows/hugo_site_deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/hugo_site_deployment.yml b/.gitea/workflows/hugo_site_deployment.yml index 716d24d..50088df 100644 --- a/.gitea/workflows/hugo_site_deployment.yml +++ b/.gitea/workflows/hugo_site_deployment.yml @@ -108,7 +108,7 @@ jobs: id: rsync uses: GuillaumeFalourd/setup-rsync@v1.2 with: - ssh-key: ${{ secrets.VPS_DEPLOY_KEY }} + ssh_key: ${{ secrets.VPS_DEPLOY_KEY }} - name: Verifying key path run: | echo "SSK KEY PATH: ${{ steps.rsync.outputs.ssh_key_path }}" From bcb08182d8f56e0a5057318f4b0ce4911e72a9ef Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 22 Jul 2025 17:54:37 -0400 Subject: [PATCH 05/13] Tshooting rsync #I-lost-count... --- .gitea/workflows/hugo_site_deployment.yml | 120 ++++++++++++++-------- 1 file changed, 79 insertions(+), 41 deletions(-) diff --git a/.gitea/workflows/hugo_site_deployment.yml b/.gitea/workflows/hugo_site_deployment.yml index 50088df..3c38480 100644 --- a/.gitea/workflows/hugo_site_deployment.yml +++ b/.gitea/workflows/hugo_site_deployment.yml @@ -105,22 +105,45 @@ jobs: notification_title: 'GITEA: Hugo' notification_message: 'Broken link inspection done... 🔍' - name: Setup rsync - id: rsync + id: setup_rsync uses: GuillaumeFalourd/setup-rsync@v1.2 with: ssh_key: ${{ secrets.VPS_DEPLOY_KEY }} - - name: Verifying key path - run: | - echo "SSK KEY PATH: ${{ steps.rsync.outputs.ssh_key_path }}" - name: Testing rsync env: VPS_DEPLOY_USER: ${{ secrets.HUGO_DEPLOY_USERNAME }} VPS_DEPLOY_HOST: ${{ secrets.HUGO_SITE_HOST }} VPS_DEPLOY_DEST: ${{ secrets.VPS_DEPLOY_DEST }} - VPS_DEPLOY_KEY: | - ${{ secrets.VPS_DEPLOY_KEY }} + VPS_DEPLOY_KEY: ${{ steps.setup_rsync.outputs.ssh_key_path }} run: | - rsync -e 'ssh -o StrictHostKeyChecking=no' -avz --progress --dry-run README.md charish@${VPS_DEPLOY_HOST}:${VPS_DEPLOY_DEST} + rsync -e 'ssh -i ${VPS_DEPLOY_KEY} -o StrictHostKeyChecking=no' -avz --progress --dry-run README.md charish@${VPS_DEPLOY_HOST}:${VPS_DEPLOY_DEST} + - name: Gotify Notification + uses: eikendev/gotify-action@master + with: + gotify_api_base: '${{ secrets.RINOA_GOTIFY_URL }}' + gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}' + notification_title: 'GITEA: Hugo' + notification_message: 'Starting Hugo deployment... 🤞🏽' + - name: Generate Hugo Site & Deploy for Docker + env: + VPS_DEPLOY_USER: ${{ secrets.HUGO_DEPLOY_USERNAME }} + VPS_DEPLOY_HOST: ${{ secrets.HUGO_SITE_HOST }} + VPS_DEPLOY_DEST: ${{ secrets.VPS_DEPLOY_DEST }} + VPS_DEPLOY_KEY: | + $$ {{ secrets.VPS_DEPLOY_KEY }} + run: | + hugo version + hugo --minify --source . + rsync --progress -avz -e 'ssh -o StrictHostKeyChecking=no' ./public ${VPS_DEPLOY_USER}@${VPS_DEPLOY_HOST}:${VPS_DEPLOY_DEST} + - name: Restart Hugo Container + uses: appleboy/ssh-action@v1.2.2 + with: + host: ${{ secrets.HUGO_SITE_HOST }} + username: ${{ secrets.HUGO_DEPLOY_USERNAME }} + password: ${{ secrets.HUGO_DEPLOY_PASSWORD }} + key: ${{ secrets.VPS_DEPLOY_KEY }} + script: | + docker container restart hugo # pr-merge: # name: PR Merge # needs: [hugo-sanity-check] @@ -170,37 +193,52 @@ jobs: # with: # hugo-version: "latest" # extended: true - # - name: Gotify Notification - # uses: eikendev/gotify-action@master - # with: - # gotify_api_base: '${{ secrets.RINOA_GOTIFY_URL }}' - # gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}' - # notification_title: 'GITEA: Hugo' - # notification_message: 'Starting Hugo deployment... 🤞🏽' - # - name: Generate Hugo Site & Deploy for Docker - # env: - # VPS_DEPLOY_USER: ${{ secrets.HUGO_DEPLOY_USERNAME }} - # VPS_DEPLOY_HOST: ${{ secrets.HUGO_SITE_HOST }} - # VPS_DEPLOY_DEST: ${{ secrets.VPS_DEPLOY_DEST }} - # VPS_DEPLOY_KEY: | - # $$ {{ secrets.VPS_DEPLOY_KEY }} - # run: | - # hugo version - # hugo --minify --source . - # rsync --progress -avz -e 'ssh -o StrictHostKeyChecking=no' ./public ${VPS_DEPLOY_USER}@${VPS_DEPLOY_HOST}:${VPS_DEPLOY_DEST} - # - name: Restart Hugo Container - # uses: appleboy/ssh-action@v1.2.2 - # with: - # host: ${{ secrets.HUGO_SITE_HOST }} - # username: ${{ secrets.HUGO_DEPLOY_USERNAME }} - # password: ${{ secrets.HUGO_DEPLOY_PASSWORD }} - # key: ${{ secrets.VPS_DEPLOY_KEY }} - # script: | - # docker container restart hugo - # - name: Gotify Notification - # uses: eikendev/gotify-action@master - # with: - # gotify_api_base: '${{ secrets.RINOA_GOTIFY_URL }}' - # gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}' - # notification_title: 'GITEA: Hugo' - # notification_message: 'Hugo deployment successful!' \ No newline at end of file + # - name: Setup rsync + # id: setup_rsync + # uses: GuillaumeFalourd/setup-rsync@v1.2 + # with: + # ssh_key: ${{ secrets.VPS_DEPLOY_KEY }} + # - run: echo "SSK KEY PATH ${{ steps.setup_rsync.outputs.ssh_key_path }}" + # - name: Testing rsync + # env: + # VPS_DEPLOY_USER: ${{ secrets.HUGO_DEPLOY_USERNAME }} + # VPS_DEPLOY_HOST: ${{ secrets.HUGO_SITE_HOST }} + # VPS_DEPLOY_DEST: ${{ secrets.VPS_DEPLOY_DEST }} + # VPS_DEPLOY_KEY: | + # ${{ secrets.VPS_DEPLOY_KEY }} + # run: | + # rsync -e 'ssh -i ${{ steps.setup_rsync.outputs.ssh_key_path }} -o StrictHostKeyChecking=no' -avz --progress --dry-run README.md charish@${VPS_DEPLOY_HOST}:${VPS_DEPLOY_DEST} + # - name: Gotify Notification + # uses: eikendev/gotify-action@master + # with: + # gotify_api_base: '${{ secrets.RINOA_GOTIFY_URL }}' + # gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}' + # notification_title: 'GITEA: Hugo' + # notification_message: 'Starting Hugo deployment... 🤞🏽' + # - name: Generate Hugo Site & Deploy for Docker + # env: + # VPS_DEPLOY_USER: ${{ secrets.HUGO_DEPLOY_USERNAME }} + # VPS_DEPLOY_HOST: ${{ secrets.HUGO_SITE_HOST }} + # VPS_DEPLOY_DEST: ${{ secrets.VPS_DEPLOY_DEST }} + # VPS_DEPLOY_KEY: | + # $$ {{ secrets.VPS_DEPLOY_KEY }} + # run: | + # hugo version + # hugo --minify --source . + # rsync --progress -avz -e 'ssh -o StrictHostKeyChecking=no' ./public ${VPS_DEPLOY_USER}@${VPS_DEPLOY_HOST}:${VPS_DEPLOY_DEST} + # - name: Restart Hugo Container + # uses: appleboy/ssh-action@v1.2.2 + # with: + # host: ${{ secrets.HUGO_SITE_HOST }} + # username: ${{ secrets.HUGO_DEPLOY_USERNAME }} + # password: ${{ secrets.HUGO_DEPLOY_PASSWORD }} + # key: ${{ secrets.VPS_DEPLOY_KEY }} + # script: | + # docker container restart hugo + # - name: Gotify Notification + # uses: eikendev/gotify-action@master + # with: + # gotify_api_base: '${{ secrets.RINOA_GOTIFY_URL }}' + # gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}' + # notification_title: 'GITEA: Hugo' + # notification_message: 'Hugo deployment successful!' \ No newline at end of file From 50a699e2a353ede27ab8f09bbc85c9bd5c1cf639 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 22 Jul 2025 18:00:11 -0400 Subject: [PATCH 06/13] Tshooting rsync #3. --- .gitea/workflows/hugo_site_deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/hugo_site_deployment.yml b/.gitea/workflows/hugo_site_deployment.yml index 3c38480..3e75821 100644 --- a/.gitea/workflows/hugo_site_deployment.yml +++ b/.gitea/workflows/hugo_site_deployment.yml @@ -116,7 +116,7 @@ jobs: VPS_DEPLOY_DEST: ${{ secrets.VPS_DEPLOY_DEST }} VPS_DEPLOY_KEY: ${{ steps.setup_rsync.outputs.ssh_key_path }} run: | - rsync -e 'ssh -i ${VPS_DEPLOY_KEY} -o StrictHostKeyChecking=no' -avz --progress --dry-run README.md charish@${VPS_DEPLOY_HOST}:${VPS_DEPLOY_DEST} + rsync -e 'ssh -i $VPS_DEPLOY_KEY -o StrictHostKeyChecking=no' -avz --progress --dry-run README.md charish@${VPS_DEPLOY_HOST}:${VPS_DEPLOY_DEST} - name: Gotify Notification uses: eikendev/gotify-action@master with: From d5097f4dfb35a113762d011f841a94b8c73b0b05 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 22 Jul 2025 18:06:39 -0400 Subject: [PATCH 07/13] Tshooting rsync #I-lost-count... --- .gitea/workflows/hugo_site_deployment.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/hugo_site_deployment.yml b/.gitea/workflows/hugo_site_deployment.yml index 3e75821..c9bb959 100644 --- a/.gitea/workflows/hugo_site_deployment.yml +++ b/.gitea/workflows/hugo_site_deployment.yml @@ -109,12 +109,17 @@ jobs: uses: GuillaumeFalourd/setup-rsync@v1.2 with: ssh_key: ${{ secrets.VPS_DEPLOY_KEY }} + - name: Deploy key path + id: deploy_key_path + run: | + deploy_key_path=$(echo "SSK KEY PATH ${{ steps.setup_rsync.outputs.ssh_key_path }}") + echo "dkp=$deploy_key_path" >> $GITHUB_OUTPUT - name: Testing rsync env: VPS_DEPLOY_USER: ${{ secrets.HUGO_DEPLOY_USERNAME }} VPS_DEPLOY_HOST: ${{ secrets.HUGO_SITE_HOST }} VPS_DEPLOY_DEST: ${{ secrets.VPS_DEPLOY_DEST }} - VPS_DEPLOY_KEY: ${{ steps.setup_rsync.outputs.ssh_key_path }} + VPS_DEPLOY_KEY: ${{ steps.deploy_key_path.outputs.deploy_key_path }} run: | rsync -e 'ssh -i $VPS_DEPLOY_KEY -o StrictHostKeyChecking=no' -avz --progress --dry-run README.md charish@${VPS_DEPLOY_HOST}:${VPS_DEPLOY_DEST} - name: Gotify Notification From 9ad8757c54bdb3e6ce3ed4e33f2dceb08c7df6e8 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 22 Jul 2025 18:08:12 -0400 Subject: [PATCH 08/13] Tshooting rsync #I-lost-count... --- .gitea/workflows/hugo_site_deployment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/hugo_site_deployment.yml b/.gitea/workflows/hugo_site_deployment.yml index c9bb959..f570edd 100644 --- a/.gitea/workflows/hugo_site_deployment.yml +++ b/.gitea/workflows/hugo_site_deployment.yml @@ -119,9 +119,9 @@ jobs: VPS_DEPLOY_USER: ${{ secrets.HUGO_DEPLOY_USERNAME }} VPS_DEPLOY_HOST: ${{ secrets.HUGO_SITE_HOST }} VPS_DEPLOY_DEST: ${{ secrets.VPS_DEPLOY_DEST }} - VPS_DEPLOY_KEY: ${{ steps.deploy_key_path.outputs.deploy_key_path }} + VPS_DEPLOY_KEY: ${{ steps.deploy_key_path.outputs.dkp }} run: | - rsync -e 'ssh -i $VPS_DEPLOY_KEY -o StrictHostKeyChecking=no' -avz --progress --dry-run README.md charish@${VPS_DEPLOY_HOST}:${VPS_DEPLOY_DEST} + rsync -e 'ssh -i $VPS_DEPLOY_KEY -o StrictHostKeyChecking=no' -avz --progress --dry-run README.md ${VPS_DEPLOY_USER}@${VPS_DEPLOY_HOST}:${VPS_DEPLOY_DEST} - name: Gotify Notification uses: eikendev/gotify-action@master with: From b87b2d7703971c0000fafe12ae9c373a9f0f5d0d Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 22 Jul 2025 18:10:56 -0400 Subject: [PATCH 09/13] Tshooting rsync #I-lost-count... --- .gitea/workflows/hugo_site_deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/hugo_site_deployment.yml b/.gitea/workflows/hugo_site_deployment.yml index f570edd..8bdcd03 100644 --- a/.gitea/workflows/hugo_site_deployment.yml +++ b/.gitea/workflows/hugo_site_deployment.yml @@ -121,7 +121,7 @@ jobs: VPS_DEPLOY_DEST: ${{ secrets.VPS_DEPLOY_DEST }} VPS_DEPLOY_KEY: ${{ steps.deploy_key_path.outputs.dkp }} run: | - rsync -e 'ssh -i $VPS_DEPLOY_KEY -o StrictHostKeyChecking=no' -avz --progress --dry-run README.md ${VPS_DEPLOY_USER}@${VPS_DEPLOY_HOST}:${VPS_DEPLOY_DEST} + rsync -e "ssh -i ${VPS_DEPLOY_KEY} -o StrictHostKeyChecking=no" -avz --progress --dry-run README.md ${VPS_DEPLOY_USER}@${VPS_DEPLOY_HOST}:${VPS_DEPLOY_DEST} - name: Gotify Notification uses: eikendev/gotify-action@master with: From 2e9e212bc34ac8ea1a51d7be0ade56e5cd3cfcd9 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 22 Jul 2025 18:12:53 -0400 Subject: [PATCH 10/13] Tshooting rsync #I-lost-count... --- .gitea/workflows/hugo_site_deployment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/hugo_site_deployment.yml b/.gitea/workflows/hugo_site_deployment.yml index 8bdcd03..e4646c7 100644 --- a/.gitea/workflows/hugo_site_deployment.yml +++ b/.gitea/workflows/hugo_site_deployment.yml @@ -112,6 +112,7 @@ jobs: - name: Deploy key path id: deploy_key_path run: | + echo "SSK KEY PATH ${{ steps.setup_rsync.outputs.ssh_key_path }}" deploy_key_path=$(echo "SSK KEY PATH ${{ steps.setup_rsync.outputs.ssh_key_path }}") echo "dkp=$deploy_key_path" >> $GITHUB_OUTPUT - name: Testing rsync From 3844b33e4109f93951ab911be4120712a22968a1 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 22 Jul 2025 18:17:04 -0400 Subject: [PATCH 11/13] Tshooting rsync #I-lost-count... --- .gitea/workflows/hugo_site_deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/hugo_site_deployment.yml b/.gitea/workflows/hugo_site_deployment.yml index e4646c7..d25c9eb 100644 --- a/.gitea/workflows/hugo_site_deployment.yml +++ b/.gitea/workflows/hugo_site_deployment.yml @@ -122,7 +122,7 @@ jobs: VPS_DEPLOY_DEST: ${{ secrets.VPS_DEPLOY_DEST }} VPS_DEPLOY_KEY: ${{ steps.deploy_key_path.outputs.dkp }} run: | - rsync -e "ssh -i ${VPS_DEPLOY_KEY} -o StrictHostKeyChecking=no" -avz --progress --dry-run README.md ${VPS_DEPLOY_USER}@${VPS_DEPLOY_HOST}:${VPS_DEPLOY_DEST} + rsync -e "ssh -i ${VPS_DEPLOY_KEY} -o StrictHostKeyChecking=no" -avz --progress --dry-run README.md ${VPS_DEPLOY_USER}@192.168.1.254:${VPS_DEPLOY_DEST} - name: Gotify Notification uses: eikendev/gotify-action@master with: From dcee04e4238562ba1966df12fa838539ad0fcc5f Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 22 Jul 2025 18:22:36 -0400 Subject: [PATCH 12/13] Tshooting rsync #I-lost-count... --- .gitea/workflows/hugo_site_deployment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/hugo_site_deployment.yml b/.gitea/workflows/hugo_site_deployment.yml index d25c9eb..adb0589 100644 --- a/.gitea/workflows/hugo_site_deployment.yml +++ b/.gitea/workflows/hugo_site_deployment.yml @@ -112,8 +112,8 @@ jobs: - name: Deploy key path id: deploy_key_path run: | - echo "SSK KEY PATH ${{ steps.setup_rsync.outputs.ssh_key_path }}" - deploy_key_path=$(echo "SSK KEY PATH ${{ steps.setup_rsync.outputs.ssh_key_path }}") + echo "SSK KEY PATH: ${{ steps.setup_rsync.outputs.ssh_key_path }}" + deploy_key_path=$(echo ${{ steps.setup_rsync.outputs.ssh_key_path }}) echo "dkp=$deploy_key_path" >> $GITHUB_OUTPUT - name: Testing rsync env: From f2519f02d1341f85228f02de48f8b7f2355868c0 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 22 Jul 2025 18:34:41 -0400 Subject: [PATCH 13/13] ........ --- .gitea/workflows/hugo_site_deployment.yml | 171 ++++++++-------------- 1 file changed, 60 insertions(+), 111 deletions(-) diff --git a/.gitea/workflows/hugo_site_deployment.yml b/.gitea/workflows/hugo_site_deployment.yml index adb0589..db8e78c 100644 --- a/.gitea/workflows/hugo_site_deployment.yml +++ b/.gitea/workflows/hugo_site_deployment.yml @@ -104,25 +104,65 @@ jobs: gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}' notification_title: 'GITEA: Hugo' notification_message: 'Broken link inspection done... 🔍' + pr-merge: + name: PR Merge + needs: [hugo-sanity-check] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Cache tea CLI + id: cache-tea + uses: actions/cache@v4 + with: + path: /opt/hostedtoolcache/tea/${{ env.TEA_VERSION }}/x64 + key: tea-${{ runner.os }}-${{ env.TEA_VERSION }} + - name: Install tea + uses: supplypike/setup-bin@v4 + with: + uri: https://gitea.com/gitea/tea/releases/download/v${{ env.TEA_VERSION }}/tea-${{ env.TEA_VERSION }}-linux-amd64 + name: tea + version: ${{ env.TEA_VERSION }} + - name: PR Merge + id: pr_merge + run: | + tea login add --name gitea-rinoa --url ${{ secrets.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} + tea login default gitea-rinoa + echo "Merging PR..." + pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --fields index,title,head,state --output csv | egrep ${{ github.ref_name }} | awk -F"," '{print $1}' | sed -e 's|"||g') + tea pr m --repo ${{ github.repository }} --title "Auto Merge of PR ${pr_index} - ${{ github.ref_name }}" --message "Merged by ${{ github.actor }}" ${pr_index} + echo "pr_index=${pr_index}" >> $GITHUB_OUTPUT + - name: Gotify Notification + uses: eikendev/gotify-action@master + with: + gotify_api_base: '${{ secrets.RINOA_GOTIFY_URL }}' + gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}' + notification_title: 'GITEA: PR Merge Successful' + notification_message: 'PR #${{ steps.pr_mesubrge.outputs.pr_index }} merged.' + deploy-hugo-site: + name: Build and Deploy to Server + needs: [hugo-sanity-check, pr-merge] + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + submodules: true + - name: Setup Hugo + uses: peaceiris/actions-hugo@v3 + with: + hugo-version: "latest" + extended: true - name: Setup rsync id: setup_rsync uses: GuillaumeFalourd/setup-rsync@v1.2 with: ssh_key: ${{ secrets.VPS_DEPLOY_KEY }} - - name: Deploy key path + - name: Retrieve private key path for rsync id: deploy_key_path run: | - echo "SSK KEY PATH: ${{ steps.setup_rsync.outputs.ssh_key_path }}" deploy_key_path=$(echo ${{ steps.setup_rsync.outputs.ssh_key_path }}) echo "dkp=$deploy_key_path" >> $GITHUB_OUTPUT - - name: Testing rsync - env: - VPS_DEPLOY_USER: ${{ secrets.HUGO_DEPLOY_USERNAME }} - VPS_DEPLOY_HOST: ${{ secrets.HUGO_SITE_HOST }} - VPS_DEPLOY_DEST: ${{ secrets.VPS_DEPLOY_DEST }} - VPS_DEPLOY_KEY: ${{ steps.deploy_key_path.outputs.dkp }} - run: | - rsync -e "ssh -i ${VPS_DEPLOY_KEY} -o StrictHostKeyChecking=no" -avz --progress --dry-run README.md ${VPS_DEPLOY_USER}@192.168.1.254:${VPS_DEPLOY_DEST} - name: Gotify Notification uses: eikendev/gotify-action@master with: @@ -135,12 +175,12 @@ jobs: VPS_DEPLOY_USER: ${{ secrets.HUGO_DEPLOY_USERNAME }} VPS_DEPLOY_HOST: ${{ secrets.HUGO_SITE_HOST }} VPS_DEPLOY_DEST: ${{ secrets.VPS_DEPLOY_DEST }} - VPS_DEPLOY_KEY: | - $$ {{ secrets.VPS_DEPLOY_KEY }} + VPS_DEPLOY_KEY: ${{ steps.setup_rsync.outputs.dkp }} run: | + echo "${VPS_DEPLOY_KEY}" hugo version hugo --minify --source . - rsync --progress -avz -e 'ssh -o StrictHostKeyChecking=no' ./public ${VPS_DEPLOY_USER}@${VPS_DEPLOY_HOST}:${VPS_DEPLOY_DEST} + rsync -e "ssh -i ${VPS_DEPLOY_KEY} -o StrictHostKeyChecking=no" -avz --progress ./public ${VPS_DEPLOY_USER}@192.168.1.254:${VPS_DEPLOY_DEST} - name: Restart Hugo Container uses: appleboy/ssh-action@v1.2.2 with: @@ -150,101 +190,10 @@ jobs: key: ${{ secrets.VPS_DEPLOY_KEY }} script: | docker container restart hugo - # pr-merge: - # name: PR Merge - # needs: [hugo-sanity-check] - # runs-on: ubuntu-latest - # steps: - # - name: Checkout - # uses: actions/checkout@v4 - # - name: Cache tea CLI - # id: cache-tea - # uses: actions/cache@v4 - # with: - # path: /opt/hostedtoolcache/tea/${{ env.TEA_VERSION }}/x64 - # key: tea-${{ runner.os }}-${{ env.TEA_VERSION }} - # - name: Install tea - # uses: supplypike/setup-bin@v4 - # with: - # uri: https://gitea.com/gitea/tea/releases/download/v${{ env.TEA_VERSION }}/tea-${{ env.TEA_VERSION }}-linux-amd64 - # name: tea - # version: ${{ env.TEA_VERSION }} - # - name: PR Merge - # id: pr_merge - # run: | - # tea login add --name gitea-rinoa --url ${{ secrets.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} - # tea login default gitea-rinoa - # echo "Merging PR..." - # pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --fields index,title,head,state --output csv | egrep ${{ github.ref_name }} | awk -F"," '{print $1}' | sed -e 's|"||g') - # tea pr m --repo ${{ github.repository }} --title "Auto Merge of PR ${pr_index} - ${{ github.ref_name }}" --message "Merged by ${{ github.actor }}" ${pr_index} - # echo "pr_index=${pr_index}" >> $GITHUB_OUTPUT - # - name: Gotify Notification - # uses: eikendev/gotify-action@master - # with: - # gotify_api_base: '${{ secrets.RINOA_GOTIFY_URL }}' - # gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}' - # notification_title: 'GITEA: PR Merge Successful' - # notification_message: 'PR #${{ steps.pr_mesubrge.outputs.pr_index }} merged.' - # deploy-hugo-site: - # name: Build and Deploy to Server - # needs: [hugo-sanity-check, pr-merge] - # runs-on: ubuntu-latest - # steps: - # - name: Checkout Repository - # uses: actions/checkout@v4 - # with: - # submodules: true - # - name: Setup Hugo - # uses: peaceiris/actions-hugo@v3 - # with: - # hugo-version: "latest" - # extended: true - # - name: Setup rsync - # id: setup_rsync - # uses: GuillaumeFalourd/setup-rsync@v1.2 - # with: - # ssh_key: ${{ secrets.VPS_DEPLOY_KEY }} - # - run: echo "SSK KEY PATH ${{ steps.setup_rsync.outputs.ssh_key_path }}" - # - name: Testing rsync - # env: - # VPS_DEPLOY_USER: ${{ secrets.HUGO_DEPLOY_USERNAME }} - # VPS_DEPLOY_HOST: ${{ secrets.HUGO_SITE_HOST }} - # VPS_DEPLOY_DEST: ${{ secrets.VPS_DEPLOY_DEST }} - # VPS_DEPLOY_KEY: | - # ${{ secrets.VPS_DEPLOY_KEY }} - # run: | - # rsync -e 'ssh -i ${{ steps.setup_rsync.outputs.ssh_key_path }} -o StrictHostKeyChecking=no' -avz --progress --dry-run README.md charish@${VPS_DEPLOY_HOST}:${VPS_DEPLOY_DEST} - # - name: Gotify Notification - # uses: eikendev/gotify-action@master - # with: - # gotify_api_base: '${{ secrets.RINOA_GOTIFY_URL }}' - # gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}' - # notification_title: 'GITEA: Hugo' - # notification_message: 'Starting Hugo deployment... 🤞🏽' - # - name: Generate Hugo Site & Deploy for Docker - # env: - # VPS_DEPLOY_USER: ${{ secrets.HUGO_DEPLOY_USERNAME }} - # VPS_DEPLOY_HOST: ${{ secrets.HUGO_SITE_HOST }} - # VPS_DEPLOY_DEST: ${{ secrets.VPS_DEPLOY_DEST }} - # VPS_DEPLOY_KEY: | - # $$ {{ secrets.VPS_DEPLOY_KEY }} - # run: | - # hugo version - # hugo --minify --source . - # rsync --progress -avz -e 'ssh -o StrictHostKeyChecking=no' ./public ${VPS_DEPLOY_USER}@${VPS_DEPLOY_HOST}:${VPS_DEPLOY_DEST} - # - name: Restart Hugo Container - # uses: appleboy/ssh-action@v1.2.2 - # with: - # host: ${{ secrets.HUGO_SITE_HOST }} - # username: ${{ secrets.HUGO_DEPLOY_USERNAME }} - # password: ${{ secrets.HUGO_DEPLOY_PASSWORD }} - # key: ${{ secrets.VPS_DEPLOY_KEY }} - # script: | - # docker container restart hugo - # - name: Gotify Notification - # uses: eikendev/gotify-action@master - # with: - # gotify_api_base: '${{ secrets.RINOA_GOTIFY_URL }}' - # gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}' - # notification_title: 'GITEA: Hugo' - # notification_message: 'Hugo deployment successful!' \ No newline at end of file + - name: Gotify Notification + uses: eikendev/gotify-action@master + with: + gotify_api_base: '${{ secrets.RINOA_GOTIFY_URL }}' + gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}' + notification_title: 'GITEA: Hugo' + notification_message: 'Hugo deployment successful!' \ No newline at end of file