Skip to content

Deploy Hugo site to Server #173

Deploy Hugo site to Server

Deploy Hugo site to Server #173

Workflow file for this run

# Sample workflow for building and deploying a Hugo site to GitHub Pages
name: Deploy Hugo site to Server
on:
# Runs on pushes targeting the default branch
push:
branches: ['master']
workflow_run:
workflows: ['Update theme']
types:
- completed
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Default to bash
defaults:
run:
shell: bash
jobs:
# Deployment job
deploy:
environment: web-site-deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: ${{ vars.HUGO_VERSION || 'latest'}}
extended: true
- name: Clean last public
run: rm -rf public
- name: Build with Hugo
run: hugo --logLevel=warn --gc --minify
- name: copy file via ssh key
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.TENCENTCLOUD_SECRET_HOST }}
username: ${{ secrets.TENCENTCLOUD_SECRET_USERNAME }}
key: ${{ secrets.TENCENTCLOUD_SECRET_KEY }}
port: ${{ secrets.TENCENTCLOUD_SECRET_PORT }}
source: './public/*'
target: ${{ secrets.TENCENTCLOUD_SECRET_TRAGET_PATH }}