Skip to content

Commit

Permalink
feat: import dokku/ actions from moderntribe/actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ggwicz committed Feb 15, 2024
1 parent 48f99fc commit f5310c0
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
53 changes: 53 additions & 0 deletions dokku/create-review-app/action.yaml
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 }}"
}
35 changes: 35 additions & 0 deletions dokku/delete-review-app/action.yaml
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 }}"
}

0 comments on commit f5310c0

Please sign in to comment.