Initial Commit

This commit is contained in:
2025-09-06 13:28:05 +10:00
commit 7a9a8a1f15
144 changed files with 3461 additions and 0 deletions

7
content/_index.md Normal file
View File

@ -0,0 +1,7 @@
---
menu:
main:
name: Home
weight: 1
pre: fa-house
---

26
content/about/index.md Normal file
View File

@ -0,0 +1,26 @@
---
title: "About"
date: 2023-04-20
draft: false
layout: page
menu:
main:
name: About
weight: 5
pre: fa-info-circle
---
[Chirpy](https://github.com/cotes2020/jekyll-theme-chirpy) is a blog theme originally based on [Jekyll](https://jekyllrb.com/). Due to Jekyll's design limitations, it does not natively support internationalization (i18n) and requires third-party plugins for i18n functionality. To enable i18n support for Chirpy without the hassle of relying on third-party plugins, the [hugo-theme-chirpy](https://github.com/geekifan/hugo-theme-chirpy) project migrated the Chirpy theme to [Hugo](https://gohugo.io/) with minimal adaptations. All features of Chirpy are available in hugo-theme-chirpy (though some functionalities may operate differently within the Hugo framework).
Follow the posts in the demo site to quickly set up a free personal blog!
## Features
- **Dark Mode**: Enhanced readability in low-light environments.
- **Multilingual UI:** Easily switch between different languages.
- **Efficient Post Organization:** Use hierarchical categories, trending tags, recommended reading, and search functionalities.
- **Optimized Layout:** Includes TOC, syntax highlighting, prompts, and more.
- **Rich Writing Extensions:** Support for mathematical formulas, charts, flowcharts, and embedded media.
- **Multiple Comment Systems:** Choose from various commenting options.
- **Web Analysis Tools:** Integrated with multiple analytics tools.
- **Modern Web Technologies:** Built for SEO and web performance.
- **RSS Feed Support:** Keep your readers updated with RSS feeds.

10
content/archives/index.md Normal file
View File

@ -0,0 +1,10 @@
---
title: "Archives"
draft: false
layout: archives
menu:
main:
name: Archives
weight: 4
pre: fa-archive
---

View File

@ -0,0 +1,8 @@
---
title: "Categories"
menu:
main:
name: Categories
weight: 3
pre: fa-stream
---

View File

@ -0,0 +1,20 @@
---
title: Reset and Restart
date: 2024-09-05
categories: [homelab]
tags: [homelab]
image:
path: reset.jpg
---
It's time to reset the website and start building my blog again. I have had this domain for a number of years and it has always been used for my E-Mail.
But the website has been more of a play ground for experimenting and testing.
I am now hoping to get into the habit of writing more blog posts as I document my journey as I experiment with my HomeLab.

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,116 @@
---
title: Continuous Integration & Continuous Deployment
#description: Website Deployment using CI/CD Piplines
date: 2024-09-21
categories: [homelab,gitea]
tags: [homelab,git,docker,ci,cd,continuous integration,continuous deployment]
image:
path: devops.png
---
Since the reset of the website, I have been working on getting it to auto build and deploy using [Gitea Actions](https://docs.gitea.com/usage/actions/overview). Which is similar and compatible to [GitHub Actions](https://github.com/features/actions)
Before implementing the action it was a manual process which required using docker commands to login, build and push the image to the container registry.
### Why use CI/CD?
It takes the manual process steps away and does them for you, helping you to avoid missing any steps and avoiding errors. This also makes the interaction seamless and automated.
### Setting up the Aciton
To setup the action we first needed to create some "secrets" in the repo. Secrets are secure variables that are requied to interact with systems. Such as passwords, usernames, SSH Keys etc.
![gitea secrets](gitea-secrets.png)
After populating our secrets file we can then create our ```.gitea/workflows/build.yml``` file. This file contains all the steps to build, test and deploy the container.
{% raw %}
```yml
on: push
jobs:
build-node:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
- name: Install Node Dependencies
run: npm ci
- name: Build 11ty Site
run: npm run build --if-present
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
registry: git.comprofix.com
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./
file: ./Dockerfile
push: true
tags: git.comprofix.com/mmckinnon/comprofix.com:latest
publish:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
- name: Publish Website
run: |
mkdir ~/.ssh
echo "${{ secrets.SSH_KNOWN_HOSTS }}" >> ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
eval $(ssh-agent -s)
ssh-add <(echo "${{ secrets.SSH_PRIVATE_KEY }}")
ssh administrator@comprofix.com "cd /opt/comprofix; docker compose down" || true
scp docker-compose.yml administrator@comprofix.com:/opt/comprofix
ssh administrator@comprofix.com "cd /opt/comprofix; docker compose pull; docker compose up -d"
```
{% endraw %}
### build.yml explained
* ```yml
on: push
```
This tells the action to run when code is pushed to the repo.
* ```yml
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
```
This specified the "container" to use to run all the steps on. This was crucial as running without a "conatiner" would fail as not all required dependencies where available
* ```yml
jobs:
build-node:
...
publish:
```
These are the names of the separate jobs for the build action. The build node will build the site and create the new docker container and push to the registry. The publish will connect the host running the container and restart using the new container.
* ```yml
steps:
```
Each job has a list of steps it performs on the code. Most of these a pretty self explaining on what they do. Everything from check out the code. Setup Node environment and build. Run the docker commands to login to the registry, build the container and push. Then the last job steps connect the host and pull the new container and start.
### Gitea Action Completes
Once the new code was commited to the repo the Action was able to complete successfully.
![](gitea-action-successful.png)

8
content/tags/_index.md Normal file
View File

@ -0,0 +1,8 @@
---
title: "Tags"
menu:
main:
name: Tags
weight: 3
pre: fa-tags
---