From b5ae7c937c69284f173c4d31af5dddaf802a08ec Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Mon, 28 Nov 2022 10:22:20 -0500 Subject: [PATCH] delete preview after merge --- .woodpecker.yml | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 646d217..be665d3 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,6 +1,16 @@ --- branches: main +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 + clone: git: image: woodpeckerci/plugin-git @@ -16,17 +26,19 @@ pipeline: preview: image: woodpeckerci/plugin-surge-preview secrets: [SURGE_TOKEN, SURGE_GITEA] - 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 + settings: *surge_settings when: event: pull_request + teardown-preview: + image: woodpeckerci/plugin-surge-preview + secrets: [SURGE_TOKEN, SURGE_GITEA] + settings: *surge_settings + environment: + - CI_BUILD_EVENT=pull_close + when: + event: push + publish: image: git.shrug.pw/neil/containers/woodpecker-ci:latest secrets: [ssh_key]