coreos-home-server/service/hugo/container/config/hooks.yaml.template
Alex Palaistras 453c8a88f3 hugo: Use branch name from payload if possible
Gitea and Gitlab allow for filtering push events based on the branch
name, so we assume that webhook payloads don't need to be filtered based
on the branch in these cases. Github doesn't allow for this sort of
filtering, so we have to specify a default branch to filter on.
2022-10-29 15:56:46 +01:00

65 lines
1.7 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_DEFAULT_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_DEFAULT_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: payload
name: ref
trigger-rule:
and:
- match:
type: payload-hmac-sha256
secret: ${HUGO_DEPLOY_SECRET}
parameter:
source: header
name: X-Hub-Signature-256
# 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: payload
name: ref
trigger-rule:
and:
- match:
type: value
value: ${HUGO_DEPLOY_SECRET}
parameter:
source: header
name: X-Gitlab-Token