Dropping PR merge and deployment step while tshooting rsync.
This commit is contained in:
@@ -104,61 +104,11 @@ jobs:
|
|||||||
gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}'
|
gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}'
|
||||||
notification_title: 'GITEA: Hugo'
|
notification_title: 'GITEA: Hugo'
|
||||||
notification_message: 'Broken link inspection done... 🔍'
|
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
|
- name: Setup rsync
|
||||||
id: setup-rsync
|
id: setup-rsync
|
||||||
uses: GuillaumeFalourd/setup-rsync@v1.2
|
uses: GuillaumeFalourd/setup-rsync@v1.2
|
||||||
with:
|
with:
|
||||||
ssh-key: |
|
ssh-key: ${{ secrets.VPS_DEPLOY_KEY }}
|
||||||
${{ secrets.VPS_DEPLOY_KEY }}
|
|
||||||
- name: Verifying key path
|
- name: Verifying key path
|
||||||
run: echo "SSK KEY PATH ${{ steps.setup-rsync.outputs.ssh_key_path }}"
|
run: echo "SSK KEY PATH ${{ steps.setup-rsync.outputs.ssh_key_path }}"
|
||||||
- name: Testing rsync
|
- name: Testing rsync
|
||||||
@@ -170,37 +120,86 @@ jobs:
|
|||||||
${{ secrets.VPS_DEPLOY_KEY }}
|
${{ secrets.VPS_DEPLOY_KEY }}
|
||||||
run: |
|
run: |
|
||||||
rsync -e 'ssh -o StrictHostKeyChecking=no' -avz --progress --dry-run README.md charish@${VPS_DEPLOY_HOST}:${VPS_DEPLOY_DEST}
|
rsync -e 'ssh -o StrictHostKeyChecking=no' -avz --progress --dry-run README.md charish@${VPS_DEPLOY_HOST}:${VPS_DEPLOY_DEST}
|
||||||
- name: Gotify Notification
|
# pr-merge:
|
||||||
uses: eikendev/gotify-action@master
|
# name: PR Merge
|
||||||
with:
|
# needs: [hugo-sanity-check]
|
||||||
gotify_api_base: '${{ secrets.RINOA_GOTIFY_URL }}'
|
# runs-on: ubuntu-latest
|
||||||
gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}'
|
# steps:
|
||||||
notification_title: 'GITEA: Hugo'
|
# - name: Checkout
|
||||||
notification_message: 'Starting Hugo deployment... 🤞🏽'
|
# uses: actions/checkout@v4
|
||||||
- name: Generate Hugo Site & Deploy for Docker
|
# - name: Cache tea CLI
|
||||||
env:
|
# id: cache-tea
|
||||||
VPS_DEPLOY_USER: ${{ secrets.HUGO_DEPLOY_USERNAME }}
|
# uses: actions/cache@v4
|
||||||
VPS_DEPLOY_HOST: ${{ secrets.HUGO_SITE_HOST }}
|
# with:
|
||||||
VPS_DEPLOY_DEST: ${{ secrets.VPS_DEPLOY_DEST }}
|
# path: /opt/hostedtoolcache/tea/${{ env.TEA_VERSION }}/x64
|
||||||
VPS_DEPLOY_KEY: |
|
# key: tea-${{ runner.os }}-${{ env.TEA_VERSION }}
|
||||||
$$ {{ secrets.VPS_DEPLOY_KEY }}
|
# - name: Install tea
|
||||||
run: |
|
# uses: supplypike/setup-bin@v4
|
||||||
hugo version
|
# with:
|
||||||
hugo --minify --source .
|
# uri: https://gitea.com/gitea/tea/releases/download/v${{ env.TEA_VERSION }}/tea-${{ env.TEA_VERSION }}-linux-amd64
|
||||||
rsync --progress -avz -e 'ssh -o StrictHostKeyChecking=no' ./public ${VPS_DEPLOY_USER}@${VPS_DEPLOY_HOST}:${VPS_DEPLOY_DEST}
|
# name: tea
|
||||||
- name: Restart Hugo Container
|
# version: ${{ env.TEA_VERSION }}
|
||||||
uses: appleboy/ssh-action@v1.2.2
|
# - name: PR Merge
|
||||||
with:
|
# id: pr_merge
|
||||||
host: ${{ secrets.HUGO_SITE_HOST }}
|
# run: |
|
||||||
username: ${{ secrets.HUGO_DEPLOY_USERNAME }}
|
# 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 }}
|
||||||
password: ${{ secrets.HUGO_DEPLOY_PASSWORD }}
|
# tea login default gitea-rinoa
|
||||||
key: ${{ secrets.VPS_DEPLOY_KEY }}
|
# echo "Merging PR..."
|
||||||
script: |
|
# 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')
|
||||||
docker container restart hugo
|
# tea pr m --repo ${{ github.repository }} --title "Auto Merge of PR ${pr_index} - ${{ github.ref_name }}" --message "Merged by ${{ github.actor }}" ${pr_index}
|
||||||
- name: Gotify Notification
|
# echo "pr_index=${pr_index}" >> $GITHUB_OUTPUT
|
||||||
uses: eikendev/gotify-action@master
|
# - name: Gotify Notification
|
||||||
with:
|
# uses: eikendev/gotify-action@master
|
||||||
gotify_api_base: '${{ secrets.RINOA_GOTIFY_URL }}'
|
# with:
|
||||||
gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}'
|
# gotify_api_base: '${{ secrets.RINOA_GOTIFY_URL }}'
|
||||||
notification_title: 'GITEA: Hugo'
|
# gotify_app_token: '${{ secrets.RINOA_RUNNER_GOTIFY_TOKEN }}'
|
||||||
notification_message: 'Hugo deployment successful!'
|
# 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!'
|
||||||
Reference in New Issue
Block a user