Automating Hugo Deployment with Gitea Actions
Recently, I tried setting up Gitea Actions to automatically update my Hugo blog whenever I pushed new content. The idea was simple: Use Gitea’s built-in CI/CD to pull the repo, Build the site using Hugo, Deploy it to the server. Setting Up Gitea Actions First, I created a .gitea/workflows/deploy.yml file with the following steps: name: Deploy Hugo Site on: push: branches: - main jobs: build: runs-on: ubuntu-latest steps: - name: Clone repository uses: actions/checkout@v3 - name: Install Hugo run: | sudo apt update && sudo apt install -y hugo - name: Build site run: hugo -D - name: Deploy to server run: | scp -r public/* user@server:/var/www/html/ Authentication Issues 😩 To deploy, I needed SSH access to the server. Gitea doesn’t have built-in secrets management (like GitHub Actions), so I had to hardcode my SSH private key inside the workflow. ...