-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: import dokku/ actions from moderntribe/actions
- Loading branch information
Showing
2 changed files
with
88 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: ModernTribe - Create Review App | ||
description: Create Review App in Dokku Server | ||
author: moderntribe | ||
inputs: | ||
app_name: | ||
required: true | ||
description: Dokku Original App Name | ||
review_app_name: | ||
required: true | ||
description: Dokku Review App Name | ||
server: | ||
required: true | ||
description: Server Name | ||
github_pat_token: | ||
required: true | ||
description: Github Personal Access token | ||
gha_url: | ||
required: true | ||
description: Github Actions Run URL | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Check if ${{ inputs.review_app_name }} already exists | ||
id: test_app | ||
shell: bash | ||
run: | | ||
ssh -q dokku@${{ inputs.server }} apps:exists ${{ inputs.review_app_name }} || exit_code=$(echo $?) | ||
if [ -z "$exit_code" ]; then | ||
echo "App already exists. Skipping creation..." | ||
echo ::set-output name=app_exists::"true" | ||
elif [ "$exit_code" -eq 20 ]; then | ||
echo "App does not exists. Creating review app..." | ||
echo ::set-output name=app_exists::"false" | ||
else | ||
echo "The checking command failed...exiting." | ||
exit 1 | ||
fi | ||
- name: Repository Dispatch | Launch ${{ inputs.review_app_name }} | ||
if: steps.test_app.outputs.app_exists == 'false' | ||
uses: peter-evans/repository-dispatch@v1 | ||
with: | ||
repository: moderntribe/dokku-ansible | ||
event-type: create-review-app | ||
token: "${{ inputs.github_pat_token }}" | ||
client-payload: | | ||
{ | ||
"review_app_name": "${{ inputs.review_app_name }}", | ||
"app_name": "${{ inputs.app_name }}", | ||
"server": "${{ inputs.server }}", | ||
"action_url": "${{ inputs.gha_url }}" | ||
} |
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,35 @@ | ||
name: ModernTribe - Delete Review App | ||
description: Delete Review App in Dokku Server | ||
author: moderntribe | ||
inputs: | ||
app_name: | ||
required: true | ||
description: Dokku Original App Name | ||
review_app_name: | ||
required: true | ||
description: Dokku Review App Name | ||
server: | ||
required: true | ||
description: Server Name | ||
github_pat_token: | ||
required: true | ||
description: Github Personal Access token | ||
gha_url: | ||
required: true | ||
description: Github Actions Run URL | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Repository Dispatch | Delete ${{ inputs.review_app_name }} | ||
uses: peter-evans/repository-dispatch@v1 | ||
with: | ||
repository: moderntribe/dokku-ansible | ||
event-type: delete-review-app | ||
token: "${{ inputs.github_pat_token }}" | ||
client-payload: | | ||
{ | ||
"review_app_name": "${{ inputs.review_app_name }}", | ||
"app_name": "${{ inputs.app_name }}", | ||
"server": "${{ inputs.server }}", | ||
"action_url": "${{ inputs.gha_url }}" | ||
} |