-
Notifications
You must be signed in to change notification settings - Fork 790
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(render): add click-to-deploy (#57)
Signed-off-by: talboren <[email protected]>
- Loading branch information
Showing
11 changed files
with
305 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,25 @@ jobs: | |
uses: amannn/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: marocchino/sticky-pull-request-comment@v2 | ||
# When the previous steps fails, the workflow would stop. By adding this | ||
# condition you can continue the execution with the populated error message. | ||
if: always() && (steps.lint_pr_title.outputs.error_message != null) | ||
with: | ||
header: pr-title-lint-error | ||
message: | | ||
Hey there and thank you for opening this pull request! 👋🏼 | ||
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted. | ||
Details: | ||
``` | ||
${{ steps.lint_pr_title.outputs.error_message }} | ||
``` | ||
# Delete a previous comment when the issue has been resolved | ||
- if: ${{ steps.lint_pr_title.outputs.error_message == null }} | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
header: pr-title-lint-error | ||
delete: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: "Run Keep / Demo" | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' # run every day at 12:00 AM | ||
workflow_dispatch: | ||
|
||
jobs: | ||
run: | ||
name: run-keep | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 # checkout keep repo | ||
- uses: actions/setup-python@v4 # install python 3.11.1 | ||
with: | ||
python-version: '3.11.1' | ||
- run: python -m pip install . # install requirements | ||
- run: keep -v run --alerts-file examples/alerts/db_disk_space.yml | ||
env: | ||
KEEP_PROVIDER_SLACK_DEMO: ${{ secrets.SLACK_DEMO_PROVIDER }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import click | ||
|
||
|
||
class NotRequiredIf(click.Option): | ||
""" | ||
https://stackoverflow.com/questions/44247099/click-command-line-interfaces-make-options-required-if-other-optional-option-is | ||
""" | ||
|
||
def __init__(self, *args, **kwargs): | ||
self.not_required_if = kwargs.pop("not_required_if") | ||
assert self.not_required_if, "'not_required_if' parameter required" | ||
kwargs["help"] = ( | ||
kwargs.get("help", "") | ||
+ " NOTE: This argument is mutually exclusive with %s" | ||
% self.not_required_if | ||
).strip() | ||
super(NotRequiredIf, self).__init__(*args, **kwargs) | ||
|
||
def handle_parse_result(self, ctx, opts, args): | ||
we_are_present = self.name in opts | ||
other_present = self.not_required_if in opts | ||
|
||
if other_present is False: | ||
if we_are_present is False: | ||
raise click.UsageError( | ||
"Illegal usage: `%s` is required when `%s` is not provided" | ||
% (self.name, self.not_required_if) | ||
) | ||
else: | ||
self.prompt = None | ||
|
||
return super(NotRequiredIf, self).handle_parse_result(ctx, opts, args) |
Oops, something went wrong.
95890bb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
keep-wiki – ./
keep-wiki-git-main-keephq.vercel.app
keep-wiki.vercel.app
keephq.wiki
www.keephq.wiki
keep-wiki-keephq.vercel.app