neilhanlon.me/.woodpecker.yml

58 lines
1.2 KiB
YAML
Raw Normal View History

2022-11-11 21:14:34 +00:00
---
branches: main
2022-11-28 15:22:20 +00:00
variables:
surge_settings: &surge_settings
path: public
surge_token:
from_secret: SURGE_TOKEN
forge_type: gitea
forge_url: https://git.shrug.pw
forge_repo_token:
from_secret: SURGE_GITEA
2022-11-11 21:14:34 +00:00
clone:
git:
image: woodpeckerci/plugin-git
settings:
recursive: true
pipeline:
build:
image: registry.gitlab.com/pages/hugo/hugo_extended:latest
commands:
- hugo
2022-11-14 11:22:46 +00:00
preview:
image: woodpeckerci/plugin-surge-preview
secrets: [SURGE_TOKEN, SURGE_GITEA]
2022-11-28 15:22:20 +00:00
settings: *surge_settings
2022-11-14 11:22:46 +00:00
when:
event: pull_request
2022-11-28 15:22:20 +00:00
teardown-preview:
image: woodpeckerci/plugin-surge-preview
secrets: [SURGE_TOKEN, SURGE_GITEA]
settings: *surge_settings
environment:
- CI_BUILD_EVENT=pull_close
when:
2023-04-03 01:28:41 +00:00
event: pull_close
2022-11-28 15:22:20 +00:00
2022-11-11 21:14:34 +00:00
publish:
2022-11-12 03:30:37 +00:00
image: git.shrug.pw/neil/containers/woodpecker-ci:latest
2022-11-12 12:52:21 +00:00
secrets: [ssh_key]
2022-11-12 03:35:16 +00:00
environment:
- GIT_AUTHOR_NAME="Woody the Woodpecker"
- GIT_AUTHOR_EMAIL=ci@shrug.pw
2022-11-11 21:14:34 +00:00
commands:
2022-11-12 12:54:22 +00:00
- mkdir -p ~/.ssh/
- echo "$SSH_KEY" > ~/.ssh/id_rsa
2022-11-12 13:06:04 +00:00
- chmod 0700 ~/.ssh/
2022-11-12 13:03:51 +00:00
- chmod 0600 ~/.ssh/id_rsa
2022-11-11 21:16:49 +00:00
- bash deploy.sh
2022-11-14 11:22:46 +00:00
when:
branch: main
event: [push]
2022-11-14 11:22:46 +00:00