Deploy
All checks were successful
Build and Deploy Hugo Site / build-and-deploy (push) Successful in 14s

This commit is contained in:
Chris Smith
2025-11-05 19:55:38 +01:00
parent 6b0cfc49c0
commit c7d8f4868b
2 changed files with 125 additions and 30 deletions

View File

@@ -1,19 +1,38 @@
name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: [push]
name: Build and Deploy Hugo Site
run-name: ${{ gitea.actor }} is deploying to production
on:
push:
branches:
- main
jobs:
Explore-Gitea-Actions:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- name: Check out repository code
- name: Checkout repository
uses: actions/checkout@v4
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: 'latest'
extended: true
- name: Build Hugo site
run: hugo --minify
- name: Setup SSH
run: |
ls ${{ gitea.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."
mkdir -p ~/.ssh
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.HOST }} >> ~/.ssh/known_hosts
- name: Deploy to production
run: |
scp -r public/* ${{ secrets.USERNAME }}@${{ secrets.HOST }}:/var/www/sometimescode.com/
- name: Cleanup
if: always()
run: |
rm -f ~/.ssh/id_rsa