Fixing my mistake!
This commit is contained in:
parent
1e96c1dd91
commit
078d096d38
@ -1,53 +0,0 @@
|
|||||||
---
|
|
||||||
title: "Automating Hugo Deployment with Gitea Actions"
|
|
||||||
date: 2025-02-27
|
|
||||||
author: "Dev"
|
|
||||||
tags: ["gitea", "ci/cd", "hugo"]
|
|
||||||
---
|
|
||||||
|
|
||||||
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:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
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.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
I knew this wasn't ideal, but I just wanted to get it working first. Unfortunately, after multiple attempts, it still failed with permission denied (publickey) errors.
|
|
||||||
|
|
||||||
# What's Next? 🤔
|
|
||||||
Instead of fighting with Gitea Actions, I decided to try something else. In my next post, I'll explain how I switched to a simpler, more reliable approach using a sync service.
|
|
||||||
|
|
||||||
13
content/posts/oopsie.md
Normal file
13
content/posts/oopsie.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
title: "Oops... That Was a Mistake"
|
||||||
|
date: 2025-02-27
|
||||||
|
author: "Dev"
|
||||||
|
tags: ["gitea", "security", "hugo"]
|
||||||
|
---
|
||||||
|
|
||||||
|
So... turns out **posting my SSH private key** in a blog post wasn’t the smartest move. 🙃
|
||||||
|
I didn’t even realize it until someone pointed it out.
|
||||||
|
|
||||||
|
Obviously, I had to **delete the previous post** ASAP. Lesson learned: **Always double-check what you're pushing to production!**
|
||||||
|
|
||||||
|
A new, **safer** version of the post will be up soon. This time, I’ll be using a better approach—stay tuned!
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 35 KiB |
Loading…
x
Reference in New Issue
Block a user