coreos-home-server/service/hugo/container/config/hooks.yaml.template
Alex Palaistras a99e97abfe hugo: Switch to webhook-based builder
This commit switches Hugo to a webhook-based building process, with
support for Github, Gitlab, and Gitea hooks (including local versions of
Gitea) initially. In addition, Hugo-based sites are now intended to be
served under a single volume, with ingress configuration pointing to
sub-paths into the volume.

Documentation for webhook setup and NGINX proxy configuration is still
underway, and will be filled in later.
2022-10-28 17:52:05 +01:00

77 lines
2.0 KiB
Plaintext

---
# Webhook for Github.
- id: github
execute-command: /etc/hugo/deploy.sh
command-working-directory: /tmp
include-command-output-in-response: true
include-command-output-in-response-on-error: true
pass-arguments-to-command:
- source: payload
name: repository.ssh_url
- source: string
name: ${HUGO_DEPLOY_BRANCH}
trigger-rule:
and:
- match:
type: payload-hmac-sha256
secret: ${HUGO_DEPLOY_SECRET}
parameter:
source: header
name: X-Hub-Signature-256
- match:
type: value
value: refs/heads/${HUGO_DEPLOY_BRANCH}
parameter:
source: payload
name: ref
# Webhook for Gitea.
- id: gitea
execute-command: /etc/hugo/deploy.sh
command-working-directory: /tmp
include-command-output-in-response: true
include-command-output-in-response-on-error: true
pass-arguments-to-command:
- source: payload
name: repository.ssh_url
- source: string
name: ${HUGO_DEPLOY_BRANCH}
trigger-rule:
and:
- match:
type: payload-hmac-sha256
secret: ${HUGO_DEPLOY_SECRET}
parameter:
source: header
name: X-Hub-Signature-256
- match:
type: value
value: refs/heads/${HUGO_DEPLOY_BRANCH}
parameter:
source: payload
name: ref
# Webhook for Gitlab.
- id: gitlab
execute-command: /etc/hugo/deploy.sh
command-working-directory: /tmp
include-command-output-in-response: true
include-command-output-in-response-on-error: true
pass-arguments-to-command:
- source: payload
name: repository.git_ssh_url
- source: string
name: ${HUGO_DEPLOY_BRANCH}
trigger-rule:
and:
- match:
type: value
value: ${HUGO_DEPLOY_SECRET}
parameter:
source: header
name: X-Gitlab-Token
- match:
type: value
value: refs/heads/${HUGO_DEPLOY_BRANCH}
parameter:
source: payload
name: ref