diff --git a/public/images/mykey.png b/public/images/mykey.png deleted file mode 100644 index 2718b03..0000000 Binary files a/public/images/mykey.png and /dev/null differ diff --git a/public/index.html b/public/index.html index f260113..a85722f 100644 --- a/public/index.html +++ b/public/index.html @@ -97,17 +97,18 @@
-

Automating Hugo Deployment with Gitea Actions +

Oops... That Was a Mistake

-

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. -...

+

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! +

- +
diff --git a/public/index.xml b/public/index.xml index a4ecf49..f425ecf 100644 --- a/public/index.xml +++ b/public/index.xml @@ -9,44 +9,14 @@ Thu, 27 Feb 2025 00:00:00 +0000 - Automating Hugo Deployment with Gitea Actions - http://localhost:1313/posts/first-attempt/ + Oops... That Was a Mistake + http://localhost:1313/posts/i-messed-up/ Thu, 27 Feb 2025 00:00:00 +0000 - http://localhost:1313/posts/first-attempt/ - <p>Recently, I tried setting up <strong>Gitea Actions</strong> to automatically update my Hugo blog whenever I pushed new content. The idea was simple:</p> -<ul> -<li>Use Gitea’s built-in CI/CD to pull the repo,</li> -<li>Build the site using Hugo,</li> -<li>Deploy it to the server.</li> -</ul> -<h2 id="setting-up-gitea-actions">Setting Up Gitea Actions</h2> -<p>First, I created a <code>.gitea/workflows/deploy.yml</code> file with the following steps:</p> -<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#f92672">name</span>: <span style="color:#ae81ff">Deploy Hugo Site</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span><span style="color:#f92672">on</span>: -</span></span><span style="display:flex;"><span> <span style="color:#f92672">push</span>: -</span></span><span style="display:flex;"><span> <span style="color:#f92672">branches</span>: -</span></span><span style="display:flex;"><span> - <span style="color:#ae81ff">main</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span><span style="color:#f92672">jobs</span>: -</span></span><span style="display:flex;"><span> <span style="color:#f92672">build</span>: -</span></span><span style="display:flex;"><span> <span style="color:#f92672">runs-on</span>: <span style="color:#ae81ff">ubuntu-latest</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">steps</span>: -</span></span><span style="display:flex;"><span> - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">Clone repository</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">uses</span>: <span style="color:#ae81ff">actions/checkout@v3</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span> - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">Install Hugo</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">run</span>: |<span style="color:#e6db74"> -</span></span></span><span style="display:flex;"><span><span style="color:#e6db74"> sudo apt update &amp;&amp; sudo apt install -y hugo</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span> - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">Build site</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">run</span>: <span style="color:#ae81ff">hugo -D</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span> - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">Deploy to server</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">run</span>: |<span style="color:#e6db74"> -</span></span></span><span style="display:flex;"><span><span style="color:#e6db74"> scp -r public/* user@server:/var/www/html/</span> -</span></span></code></pre></div><h1 id="authentication-issues-">Authentication Issues 😩</h1> -<p>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.</p> + http://localhost:1313/posts/i-messed-up/ + <p>So&hellip; turns out <strong>posting my SSH private key</strong> in a blog post wasn’t the smartest move. 🙃<br> +I didn’t even realize it until someone pointed it out.</p> +<p>Obviously, I had to <strong>delete the previous post</strong> ASAP. Lesson learned: <strong>Always double-check what you&rsquo;re pushing to production!</strong></p> +<p>A new, <strong>safer</strong> version of the post will be up soon. This time, I’ll be using a better approach—stay tuned!</p> diff --git a/public/mykey.png b/public/mykey.png deleted file mode 100644 index 2718b03..0000000 Binary files a/public/mykey.png and /dev/null differ diff --git a/public/posts/first-attempt/index.html b/public/posts/first-attempt/index.html deleted file mode 100644 index cd6d710..0000000 --- a/public/posts/first-attempt/index.html +++ /dev/null @@ -1,240 +0,0 @@ - - - - - - - -Automating Hugo Deployment with Gitea Actions | Dev Logbook - - - - - - - - - - - - - - - - - - - -
- -
-
- -
-
- -

- 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.

-

My SSH Key

-

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.

- - -
- - -
-
- - - - - - - - - - - - - - diff --git a/public/first-attempt/index.html b/public/posts/i-messed-up/index.html similarity index 63% rename from public/first-attempt/index.html rename to public/posts/i-messed-up/index.html index 1e2eddb..ae74290 100644 --- a/public/first-attempt/index.html +++ b/public/posts/i-messed-up/index.html @@ -5,30 +5,14 @@ -Automating Hugo Deployment with Gitea Actions | Dev Logbook - - +Oops... That Was a Mistake | Dev Logbook + + - + @@ -37,7 +21,7 @@ uses: actions/checkout@v3"> - + @@ -81,10 +37,6 @@ uses: actions/checkout@v3"> @@ -126,61 +78,24 @@ uses: actions/checkout@v3">

- Automating Hugo Deployment with Gitea Actions + Oops... That Was a Mistake

-

Recently, I tried setting up Gitea Actions to automatically update my Hugo blog whenever I pushed new content. The idea was simple:

- -

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
+  

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!

- - 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.
-
-<placeholder>
-
-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.
-
diff --git a/public/posts/index.html b/public/posts/index.html index 74a3d17..2ff8450 100644 --- a/public/posts/index.html +++ b/public/posts/index.html @@ -79,17 +79,18 @@
-

Automating Hugo Deployment with Gitea Actions +

Oops... That Was a Mistake

-

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. -...

+

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! +

February 27, 2025 · Dev
- +
diff --git a/public/posts/index.xml b/public/posts/index.xml index f20dac6..4cf5b7b 100644 --- a/public/posts/index.xml +++ b/public/posts/index.xml @@ -9,44 +9,14 @@ Thu, 27 Feb 2025 00:00:00 +0000 - Automating Hugo Deployment with Gitea Actions - http://localhost:1313/posts/first-attempt/ + Oops... That Was a Mistake + http://localhost:1313/posts/i-messed-up/ Thu, 27 Feb 2025 00:00:00 +0000 - http://localhost:1313/posts/first-attempt/ - <p>Recently, I tried setting up <strong>Gitea Actions</strong> to automatically update my Hugo blog whenever I pushed new content. The idea was simple:</p> -<ul> -<li>Use Gitea’s built-in CI/CD to pull the repo,</li> -<li>Build the site using Hugo,</li> -<li>Deploy it to the server.</li> -</ul> -<h2 id="setting-up-gitea-actions">Setting Up Gitea Actions</h2> -<p>First, I created a <code>.gitea/workflows/deploy.yml</code> file with the following steps:</p> -<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#f92672">name</span>: <span style="color:#ae81ff">Deploy Hugo Site</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span><span style="color:#f92672">on</span>: -</span></span><span style="display:flex;"><span> <span style="color:#f92672">push</span>: -</span></span><span style="display:flex;"><span> <span style="color:#f92672">branches</span>: -</span></span><span style="display:flex;"><span> - <span style="color:#ae81ff">main</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span><span style="color:#f92672">jobs</span>: -</span></span><span style="display:flex;"><span> <span style="color:#f92672">build</span>: -</span></span><span style="display:flex;"><span> <span style="color:#f92672">runs-on</span>: <span style="color:#ae81ff">ubuntu-latest</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">steps</span>: -</span></span><span style="display:flex;"><span> - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">Clone repository</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">uses</span>: <span style="color:#ae81ff">actions/checkout@v3</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span> - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">Install Hugo</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">run</span>: |<span style="color:#e6db74"> -</span></span></span><span style="display:flex;"><span><span style="color:#e6db74"> sudo apt update &amp;&amp; sudo apt install -y hugo</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span> - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">Build site</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">run</span>: <span style="color:#ae81ff">hugo -D</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span> - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">Deploy to server</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">run</span>: |<span style="color:#e6db74"> -</span></span></span><span style="display:flex;"><span><span style="color:#e6db74"> scp -r public/* user@server:/var/www/html/</span> -</span></span></code></pre></div><h1 id="authentication-issues-">Authentication Issues 😩</h1> -<p>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.</p> + http://localhost:1313/posts/i-messed-up/ + <p>So&hellip; turns out <strong>posting my SSH private key</strong> in a blog post wasn’t the smartest move. 🙃<br> +I didn’t even realize it until someone pointed it out.</p> +<p>Obviously, I had to <strong>delete the previous post</strong> ASAP. Lesson learned: <strong>Always double-check what you&rsquo;re pushing to production!</strong></p> +<p>A new, <strong>safer</strong> version of the post will be up soon. This time, I’ll be using a better approach—stay tuned!</p> diff --git a/public/sitemap.xml b/public/sitemap.xml index 341d0cf..f28a3a0 100644 --- a/public/sitemap.xml +++ b/public/sitemap.xml @@ -2,12 +2,6 @@ - http://localhost:1313/posts/first-attempt/ - 2025-02-27T00:00:00+00:00 - - http://localhost:1313/tags/ci/cd/ - 2025-02-27T00:00:00+00:00 - http://localhost:1313/ 2025-02-27T00:00:00+00:00 @@ -16,9 +10,15 @@ http://localhost:1313/tags/hugo/ 2025-02-27T00:00:00+00:00 + + http://localhost:1313/posts/i-messed-up/ + 2025-02-27T00:00:00+00:00 http://localhost:1313/posts/ 2025-02-27T00:00:00+00:00 + + http://localhost:1313/tags/security/ + 2025-02-27T00:00:00+00:00 http://localhost:1313/tags/ 2025-02-27T00:00:00+00:00 diff --git a/public/tags/ci/cd/index.xml b/public/tags/ci/cd/index.xml deleted file mode 100644 index d7eb2b8..0000000 --- a/public/tags/ci/cd/index.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - Ci/Cd on Dev Logbook - http://localhost:1313/tags/ci/cd/ - Recent content in Ci/Cd on Dev Logbook - Hugo -- 0.145.0 - en-us - Thu, 27 Feb 2025 00:00:00 +0000 - - - Automating Hugo Deployment with Gitea Actions - http://localhost:1313/posts/first-attempt/ - Thu, 27 Feb 2025 00:00:00 +0000 - http://localhost:1313/posts/first-attempt/ - <p>Recently, I tried setting up <strong>Gitea Actions</strong> to automatically update my Hugo blog whenever I pushed new content. The idea was simple:</p> -<ul> -<li>Use Gitea’s built-in CI/CD to pull the repo,</li> -<li>Build the site using Hugo,</li> -<li>Deploy it to the server.</li> -</ul> -<h2 id="setting-up-gitea-actions">Setting Up Gitea Actions</h2> -<p>First, I created a <code>.gitea/workflows/deploy.yml</code> file with the following steps:</p> -<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#f92672">name</span>: <span style="color:#ae81ff">Deploy Hugo Site</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span><span style="color:#f92672">on</span>: -</span></span><span style="display:flex;"><span> <span style="color:#f92672">push</span>: -</span></span><span style="display:flex;"><span> <span style="color:#f92672">branches</span>: -</span></span><span style="display:flex;"><span> - <span style="color:#ae81ff">main</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span><span style="color:#f92672">jobs</span>: -</span></span><span style="display:flex;"><span> <span style="color:#f92672">build</span>: -</span></span><span style="display:flex;"><span> <span style="color:#f92672">runs-on</span>: <span style="color:#ae81ff">ubuntu-latest</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">steps</span>: -</span></span><span style="display:flex;"><span> - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">Clone repository</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">uses</span>: <span style="color:#ae81ff">actions/checkout@v3</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span> - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">Install Hugo</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">run</span>: |<span style="color:#e6db74"> -</span></span></span><span style="display:flex;"><span><span style="color:#e6db74"> sudo apt update &amp;&amp; sudo apt install -y hugo</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span> - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">Build site</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">run</span>: <span style="color:#ae81ff">hugo -D</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span> - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">Deploy to server</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">run</span>: |<span style="color:#e6db74"> -</span></span></span><span style="display:flex;"><span><span style="color:#e6db74"> scp -r public/* user@server:/var/www/html/</span> -</span></span></code></pre></div><h1 id="authentication-issues-">Authentication Issues 😩</h1> -<p>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.</p> - - - diff --git a/public/tags/gitea/index.html b/public/tags/gitea/index.html index e8fad32..ac8def5 100644 --- a/public/tags/gitea/index.html +++ b/public/tags/gitea/index.html @@ -79,17 +79,18 @@
-

Automating Hugo Deployment with Gitea Actions +

Oops... That Was a Mistake

-

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. -...

+

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! +

February 27, 2025 · Dev
- +
diff --git a/public/tags/gitea/index.xml b/public/tags/gitea/index.xml index 583565f..9376694 100644 --- a/public/tags/gitea/index.xml +++ b/public/tags/gitea/index.xml @@ -9,44 +9,14 @@ Thu, 27 Feb 2025 00:00:00 +0000 - Automating Hugo Deployment with Gitea Actions - http://localhost:1313/posts/first-attempt/ + Oops... That Was a Mistake + http://localhost:1313/posts/i-messed-up/ Thu, 27 Feb 2025 00:00:00 +0000 - http://localhost:1313/posts/first-attempt/ - <p>Recently, I tried setting up <strong>Gitea Actions</strong> to automatically update my Hugo blog whenever I pushed new content. The idea was simple:</p> -<ul> -<li>Use Gitea’s built-in CI/CD to pull the repo,</li> -<li>Build the site using Hugo,</li> -<li>Deploy it to the server.</li> -</ul> -<h2 id="setting-up-gitea-actions">Setting Up Gitea Actions</h2> -<p>First, I created a <code>.gitea/workflows/deploy.yml</code> file with the following steps:</p> -<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#f92672">name</span>: <span style="color:#ae81ff">Deploy Hugo Site</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span><span style="color:#f92672">on</span>: -</span></span><span style="display:flex;"><span> <span style="color:#f92672">push</span>: -</span></span><span style="display:flex;"><span> <span style="color:#f92672">branches</span>: -</span></span><span style="display:flex;"><span> - <span style="color:#ae81ff">main</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span><span style="color:#f92672">jobs</span>: -</span></span><span style="display:flex;"><span> <span style="color:#f92672">build</span>: -</span></span><span style="display:flex;"><span> <span style="color:#f92672">runs-on</span>: <span style="color:#ae81ff">ubuntu-latest</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">steps</span>: -</span></span><span style="display:flex;"><span> - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">Clone repository</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">uses</span>: <span style="color:#ae81ff">actions/checkout@v3</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span> - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">Install Hugo</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">run</span>: |<span style="color:#e6db74"> -</span></span></span><span style="display:flex;"><span><span style="color:#e6db74"> sudo apt update &amp;&amp; sudo apt install -y hugo</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span> - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">Build site</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">run</span>: <span style="color:#ae81ff">hugo -D</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span> - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">Deploy to server</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">run</span>: |<span style="color:#e6db74"> -</span></span></span><span style="display:flex;"><span><span style="color:#e6db74"> scp -r public/* user@server:/var/www/html/</span> -</span></span></code></pre></div><h1 id="authentication-issues-">Authentication Issues 😩</h1> -<p>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.</p> + http://localhost:1313/posts/i-messed-up/ + <p>So&hellip; turns out <strong>posting my SSH private key</strong> in a blog post wasn’t the smartest move. 🙃<br> +I didn’t even realize it until someone pointed it out.</p> +<p>Obviously, I had to <strong>delete the previous post</strong> ASAP. Lesson learned: <strong>Always double-check what you&rsquo;re pushing to production!</strong></p> +<p>A new, <strong>safer</strong> version of the post will be up soon. This time, I’ll be using a better approach—stay tuned!</p> diff --git a/public/tags/hugo/index.html b/public/tags/hugo/index.html index 9c21185..5ea5fc8 100644 --- a/public/tags/hugo/index.html +++ b/public/tags/hugo/index.html @@ -79,17 +79,18 @@
-

Automating Hugo Deployment with Gitea Actions +

Oops... That Was a Mistake

-

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. -...

+

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! +

February 27, 2025 · Dev
- +
diff --git a/public/tags/hugo/index.xml b/public/tags/hugo/index.xml index 7d80a85..935a82e 100644 --- a/public/tags/hugo/index.xml +++ b/public/tags/hugo/index.xml @@ -9,44 +9,14 @@ Thu, 27 Feb 2025 00:00:00 +0000 - Automating Hugo Deployment with Gitea Actions - http://localhost:1313/posts/first-attempt/ + Oops... That Was a Mistake + http://localhost:1313/posts/i-messed-up/ Thu, 27 Feb 2025 00:00:00 +0000 - http://localhost:1313/posts/first-attempt/ - <p>Recently, I tried setting up <strong>Gitea Actions</strong> to automatically update my Hugo blog whenever I pushed new content. The idea was simple:</p> -<ul> -<li>Use Gitea’s built-in CI/CD to pull the repo,</li> -<li>Build the site using Hugo,</li> -<li>Deploy it to the server.</li> -</ul> -<h2 id="setting-up-gitea-actions">Setting Up Gitea Actions</h2> -<p>First, I created a <code>.gitea/workflows/deploy.yml</code> file with the following steps:</p> -<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#f92672">name</span>: <span style="color:#ae81ff">Deploy Hugo Site</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span><span style="color:#f92672">on</span>: -</span></span><span style="display:flex;"><span> <span style="color:#f92672">push</span>: -</span></span><span style="display:flex;"><span> <span style="color:#f92672">branches</span>: -</span></span><span style="display:flex;"><span> - <span style="color:#ae81ff">main</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span><span style="color:#f92672">jobs</span>: -</span></span><span style="display:flex;"><span> <span style="color:#f92672">build</span>: -</span></span><span style="display:flex;"><span> <span style="color:#f92672">runs-on</span>: <span style="color:#ae81ff">ubuntu-latest</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">steps</span>: -</span></span><span style="display:flex;"><span> - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">Clone repository</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">uses</span>: <span style="color:#ae81ff">actions/checkout@v3</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span> - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">Install Hugo</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">run</span>: |<span style="color:#e6db74"> -</span></span></span><span style="display:flex;"><span><span style="color:#e6db74"> sudo apt update &amp;&amp; sudo apt install -y hugo</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span> - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">Build site</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">run</span>: <span style="color:#ae81ff">hugo -D</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span> - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">Deploy to server</span> -</span></span><span style="display:flex;"><span> <span style="color:#f92672">run</span>: |<span style="color:#e6db74"> -</span></span></span><span style="display:flex;"><span><span style="color:#e6db74"> scp -r public/* user@server:/var/www/html/</span> -</span></span></code></pre></div><h1 id="authentication-issues-">Authentication Issues 😩</h1> -<p>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.</p> + http://localhost:1313/posts/i-messed-up/ + <p>So&hellip; turns out <strong>posting my SSH private key</strong> in a blog post wasn’t the smartest move. 🙃<br> +I didn’t even realize it until someone pointed it out.</p> +<p>Obviously, I had to <strong>delete the previous post</strong> ASAP. Lesson learned: <strong>Always double-check what you&rsquo;re pushing to production!</strong></p> +<p>A new, <strong>safer</strong> version of the post will be up soon. This time, I’ll be using a better approach—stay tuned!</p> diff --git a/public/tags/index.html b/public/tags/index.html index 8bbc6a5..e5539a3 100644 --- a/public/tags/index.html +++ b/public/tags/index.html @@ -76,15 +76,15 @@ diff --git a/public/tags/index.xml b/public/tags/index.xml index 039263b..7e95251 100644 --- a/public/tags/index.xml +++ b/public/tags/index.xml @@ -8,13 +8,6 @@ en-us Thu, 27 Feb 2025 00:00:00 +0000 - - Ci/Cd - http://localhost:1313/tags/ci/cd/ - Thu, 27 Feb 2025 00:00:00 +0000 - http://localhost:1313/tags/ci/cd/ - - Gitea http://localhost:1313/tags/gitea/ @@ -29,5 +22,12 @@ http://localhost:1313/tags/hugo/ + + Security + http://localhost:1313/tags/security/ + Thu, 27 Feb 2025 00:00:00 +0000 + http://localhost:1313/tags/security/ + + diff --git a/public/tags/ci/cd/index.html b/public/tags/security/index.html similarity index 83% rename from public/tags/ci/cd/index.html rename to public/tags/security/index.html index 0467ec9..c4e45ab 100644 --- a/public/tags/ci/cd/index.html +++ b/public/tags/security/index.html @@ -5,11 +5,11 @@ -Ci/Cd | Dev Logbook +Security | Dev Logbook - + @@ -18,8 +18,8 @@ - - + +