Fixed bug with images
This commit is contained in:
parent
75af981c64
commit
30aa956a5b
@ -1,6 +1,6 @@
|
||||
---
|
||||
date: 2025-02-17T21:16:00+01:00
|
||||
draft: false
|
||||
draft: true
|
||||
title: Automating my website using the Gitea act runner
|
||||
---
|
||||
Currently, when I make a change or add content to my web page after committing my changes to Gitea, I need to manually build the web page using the hugo command and then copy the files to my web host. This process can be automated using the Gitea act runner!
|
||||
@ -69,11 +69,11 @@ container:
|
||||
|
||||
Using this docker compose file and config the Gitea server and runner are started and are able to connect!
|
||||
|
||||
![[runner_status.png]]
|
||||

|
||||
|
||||
The test job supplied by Gitea is run and is successful!
|
||||
|
||||
![[job_success.png]]
|
||||

|
||||
|
||||
## Configuring the workflow
|
||||
|
||||
@ -119,7 +119,7 @@ jobs:
|
||||
|
||||
Firstly go is installed and then the Hugo application is compiled with go. Next the ssh keys, The private key for the container and the public key for the server, are copied into place to allow the generated website to be installed on the targeted server. These keys are configured in Gitea in the action secrets
|
||||
|
||||
![[runner_secrets.png]]
|
||||

|
||||
|
||||
However before this can work some work needs to be done on the server hosting the website. The runner needs a user that has the correct permissions to edit the web server files and that user needs to have the correct shh keys. Because I'm into automating as much as I can in my home lab I naturally edited my Ansible role for Gitea to make these changed for me. Below is my role for Gitea:
|
||||
|
||||
@ -181,10 +181,10 @@ Unfortunately I can't thing if an eloquent way of automating the creation of the
|
||||
|
||||
The private key in the file `runner_key` is copied to the Gitea secrets, the public key is added to the variables section of the Ansible playbook. And finally the public ssh key of the server `/etc/ssh/ssh_host_rsa_key.pub` is added to the secrets as the fingerprint. In this case I logged into the server running my web server and copied the keys from there.
|
||||
|
||||
![[the_workflow_works.png]]
|
||||

|
||||
|
||||
After creating some content on my website and pushing the changes I'm able to see my new test post!
|
||||
|
||||
![[my_post.png]]
|
||||

|
||||
|
||||
There are definitely things to improve here. The runner container could use a purpose made image to run the container with Hugo already built. This would speed up the time it takes for the action to be run. However, this is my first real use of any CI/CD pipelines and I'm happy with the end result!
|
||||
Loading…
x
Reference in New Issue
Block a user