- Added the Deployment workflow

This commit is contained in:
2025-11-25 21:30:50 +01:00
parent 6c2a521229
commit e706457ba0

View File

@@ -1,43 +1,42 @@
name: Gitea Actions - Hugo Deploy name: Gitea Actions - Hugo Deploy
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 run-name: ${{ gitea.actor }} is deploying Hugo 🚀
on: on:
push: push:
branches: branches:
- master - master
jobs: jobs:
Hugo-Deploy: Hugo-Deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." - run: echo "🎉 Triggered by a ${{ gitea.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" - run: echo "🐧 Running on ${{ runner.os }}."
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- name: Check out repository code - name: Check out repository code
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
submodules: true # Fetch Hugo themes (true OR recursive) submodules: true
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod fetch-depth: 0
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
- name: Setup Hugo - name: Setup Hugo
uses: peaceiris/actions-hugo@v3 uses: peaceiris/actions-hugo@v3
with: with:
hugo-version: "0.134.1" # or remove this for the latest hugo-version: "0.134.1"
extended: true extended: true
- name: List files in the repository - name: Build Hugo site
run: | run: hugo --minify
ls
- name: Build - name: Deploy to Ubuntu server via SCP
run: hugo uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_KEY }}
source: "public/*"
target: "/var/www/www-hahmann-trier-de/"
strip_components: 1
- name: Deploy - run: echo "🍏 Deployment finished with status: ${{ job.status }}."
run: hugo deploy
env:
AWS_REGION: "ap-southeast-2"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- run: echo "🍏 This job's status is ${{ job.status }}."