Files
sometimescode.com/.gitea/workflows/demo.yaml
Chris Smith c7d8f4868b
All checks were successful
Build and Deploy Hugo Site / build-and-deploy (push) Successful in 14s
Deploy
2025-11-05 19:55:38 +01:00

38 lines
917 B
YAML

name: Build and Deploy Hugo Site
run-name: ${{ gitea.actor }} is deploying to production
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- 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: |
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