From 50c095c6de6557db6690a7d39335bf1a5e6ea1e9 Mon Sep 17 00:00:00 2001 From: noah Date: Tue, 23 Nov 2021 23:42:18 +0900 Subject: [PATCH] Add the documentation for auto-deployment --- docs/references/deploy.yml.md | 4 ++-- docs/tasks/usecases.md | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/references/deploy.yml.md b/docs/references/deploy.yml.md index 44b65e88..a6b2e15c 100644 --- a/docs/references/deploy.yml.md +++ b/docs/references/deploy.yml.md @@ -17,8 +17,8 @@ Field |Type |Required |Description `required_contexts` |*[]string* |`false` |This field allows you to specify a subset of contexts that must be success. `payload` |*object* or *string* |`false` |This field is JSON payload with extra information about the deployment. `production_environment` |*boolean* |`false` |This field specifies whether this runtime environment is production or not. -`deployable_ref` |*string* |`false` |This field specifies which the ref(branch, SHA, tag) is deployable or not. It supports the regular expression, [re2](https://github.com/google/re2/wiki/Syntax) by Google, to match the ref. -`auto_deploy_on` |*string* |`false` |This field controls auto-deployment behaviour given a ref(branch, SHA, tag). It supports the regular expression, [re2](https://github.com/google/re2/wiki/Syntax) by Google, to match the ref. +`deployable_ref` |*string* |`false` |This field specifies which the ref(branch, SHA, tag) is deployable or not. It supports the regular expression ([re2]((https://github.com/google/re2/wiki/Syntax))). +`auto_deploy_on` |*string* |`false` |This field controls auto-deployment behaviour given a ref(branch, SHA, tag). If any new push events are detected on this event, the deployment will be triggered. It supports the regular expression ([re2](https://github.com/google/re2/wiki/Syntax)). E.g. `refs/heads/main` or `refs/tags/v.*` `review` |*[Review](#review)* |`false` |This field configures review. ## Review diff --git a/docs/tasks/usecases.md b/docs/tasks/usecases.md index 7ede7bf7..9b025891 100644 --- a/docs/tasks/usecases.md +++ b/docs/tasks/usecases.md @@ -37,6 +37,20 @@ envs: production_environment: true ``` +## Auto deployment + +If you want to enable the auto-deployment when the pull request is merged into the main branch, you should configure the `auto_deploy_on` field like the below. + +```yaml +envs: + - name: production + auto_merge: true + required_contexts: [] + auto_deploy_on: refs/heads/main + deployable_ref: main + production_environment: true +``` + ## Questions? We are always happy to help with questions you might have. You can post questions or comments to our [community](https://github.com/gitploy-io/gitploy/discussions).