Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Rename the post

Rename the post #24

Workflow file for this run

on:
push:
branches:
- master
paths:
- 'archetypes/**'
- 'content/**'
- 'layouts/**'
- 'themes/**'
- 'hugo.yaml'
jobs:
deploy:
runs-on: ubuntu-22.04
environment: ssh
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v4
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.139.0'
extended: true
- name: Set up SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
echo "${{ secrets.SSH_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
- name: Deploy to server # run deploy.sh script
run: bash deploy.sh
env:
REMOTE_SSH_HOST: ${{ secrets.REMOTE_SSH_HOST }}
REMOTE_SSH_PORT: ${{ secrets.REMOTE_SSH_PORT }}
REMOTE_DIR: ${{ secrets.REMOTE_DIR }}