CI: Build the Website with Hugo and publish it to Codeberg pages #4

Merged
rluetzner merged 0 commits from refs/pull/4/head into develop 2023-05-18 22:04:20 +02:00
rluetzner commented 2023-05-18 20:52:12 +02:00 (Migrated from codeberg.org)

This requires the following secrets to be configured in the Woodpecker
UI:

  • mail: I chose no-reply@codeberg.org. Not really a secret, in my
    opinion.
  • codeberg_token: A valid Codeberg API token with write access, because
    we want to push changes to the Git repo.

The build steps will also trigger on 'cron'. However, it is currently
not possible to define the cronjob in the pipeline directly. We have to
create it in the Woodpecker UI instead. It can be found in 'Settings'
--> 'Crons'. I chose '0 42 2 * * *', i.e. every night at 2:42.

We also add the '.domains' file here. Previously it only existed on the
'pages' branch, but having it on the main branch makes it more explicit.
The file is copied over to the 'pages' branch after the CI builds a new
version of the website.

This requires the following secrets to be configured in the Woodpecker UI: - mail: I chose no-reply@codeberg.org. Not really a secret, in my opinion. - codeberg_token: A valid Codeberg API token with write access, because we want to push changes to the Git repo. The build steps will also trigger on 'cron'. However, it is currently not possible to define the cronjob in the pipeline directly. We have to create it in the Woodpecker UI instead. It can be found in 'Settings' --> 'Crons'. I chose '0 42 2 * * *', i.e. every night at 2:42. We also add the '.domains' file here. Previously it only existed on the 'pages' branch, but having it on the main branch makes it more explicit. The file is copied over to the 'pages' branch after the CI builds a new version of the website.
rluetzner commented 2023-05-18 20:54:39 +02:00 (Migrated from codeberg.org)

Once you get access to the CI, you'll have to enable the repository first and then configure the settings mentioned in the commit message.

If you're wondering what a "failed pipeline" for the 'pages' branch looks like:
image

I hope it's somewhat understandable what's going on. Basically Woodpecker will try to load and run any pipelines from a .woodpecker.yml file. The file doesn't exist on the 'pages' branch, which is why it fails. It doesn't matter that all our pipelines are limited to the 'master' branch. If Woodpecker were to find the file on the 'pages' branch, it would simply do nothing and show a green/successful pipeline for the commit on the branch instead.

Once you get access to the CI, you'll have to enable the repository first and then configure the settings mentioned in the commit message. If you're wondering what a "failed pipeline" for the 'pages' branch looks like: ![image](/attachments/60227567-3477-48e2-a165-5a2a7ca7ebd9) I hope it's somewhat understandable what's going on. Basically Woodpecker will try to load and run any pipelines from a .woodpecker.yml file. The file doesn't exist on the 'pages' branch, which is why it fails. It doesn't matter that all our pipelines are limited to the 'master' branch. If Woodpecker were to find the file on the 'pages' branch, it would simply do nothing and show a green/successful pipeline for the commit on the branch instead.
rluetzner commented 2023-05-18 20:56:22 +02:00 (Migrated from codeberg.org)

I understand that this alone won't help with the donations page, but automating the website generation and getting the latest donation infos is not really related. That's why I thought we could tackle the CI first.

I understand that this alone won't help with the donations page, but automating the website generation and getting the latest donation infos is not really related. That's why I thought we could tackle the CI first.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
RollenspielMonster/website!4
No description provided.