[MOOSE-161] Register training
CPT
#403
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
name: 'Dokku Review App' | |
on: | |
workflow_dispatch: | |
pull_request: | |
types: [ opened, closed, synchronize ] | |
# workflows don't support env | |
# so values are duplicated | |
jobs: | |
create_review_app: | |
if: (github.event_name == 'pull_request' && github.event.action == 'opened' || github.event.action == 'synchronize') && contains(github.event.pull_request.labels.*.name, 'Launch Environment') | |
uses: moderntribe/actions/.github/workflows/create-review-app.yml@v1 | |
with: | |
app_name: moose-dev | |
pr_number: ${{ github.event.number }} | |
secrets: | |
github_pat_token: ${{ secrets.GH_BOT_TOKEN }} | |
server: d1.moderntribe.qa | |
ssh_private_key: ${{ secrets.DOKKU_DEPLOY_KEY }} | |
deploy_review_app: | |
if: (github.event_name == 'pull_request' && github.event.action == 'opened' || github.event.action == 'synchronize') && contains(github.event.pull_request.labels.*.name, 'Launch Environment') | |
uses: ./.github/workflows/pipeline-dokku.yml | |
with: | |
app_name: moose-dev | |
branch: ${{ github.event.pull_request.head.ref }} | |
pr_number: ${{ github.event.number }} | |
is_review_app: true | |
server: d1.moderntribe.qa | |
secrets: | |
github_pat_token: ${{ secrets.GH_BOT_TOKEN }} | |
ssh_private_key: ${{ secrets.DOKKU_DEPLOY_KEY }} | |
slack_webhook: ${{ secrets.SLACK_WEBHOOK }} | |
composer_auth_json: ${{ secrets.COMPOSER_AUTH_JSON }} | |
destroy_review_app: | |
if: (github.event_name == 'pull_request' && github.event.action == 'closed') && contains(github.event.pull_request.labels.*.name, 'Launch Environment') | |
uses: moderntribe/actions/.github/workflows/delete-review-app.yml@v1 | |
with: | |
app_name: moose-dev | |
pr_number: ${{ github.event.number }} | |
secrets: | |
github_pat_token: ${{ secrets.GH_BOT_TOKEN }} | |
server: d1.moderntribe.qa | |
complete_workflow: | |
if: ${{ always() }} | |
needs: [create_review_app, deploy_review_app, destroy_review_app] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Complete Workflow | |
run: echo "Dokku Deploy Review App workflow complete." |