Skip to content

Fork bombei93

Fork bombei93 #17

Workflow file for this run

name: PR Environment
on:
pull_request_target:
types:
- opened
- synchronize
- reopened
- closed
branches:
- development
# TODO: add release-* ??
# TODO: remove branches condition ??
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
create-gh-environment:
if: |
github.event.action == 'opened' ||
github.event.action == 'synchronize' ||
github.event.action == 'reopened'
uses: nepalevov/ai-dial-ci/.github/workflows/gh_environment.yml@main
with:
operation: create
secrets:
ACTIONS_BOT_TOKEN: ${{ secrets.ACTIONS_BOT_TOKEN }}
# HINT: outputs: ["environment_name", "environment_fqdn", "environment_url"]
delete-gh-environment:
if: github.event.action == 'closed'
uses: nepalevov/ai-dial-ci/.github/workflows/gh_environment.yml@main
with:
operation: delete
secrets:
ACTIONS_BOT_TOKEN: ${{ secrets.ACTIONS_BOT_TOKEN }}
# HINT: outputs: ["environment_name", "environment_fqdn", "environment_url"]
destroy-review:
if: github.event.action == 'closed'
runs-on: ubuntu-latest
needs:
- delete-gh-environment
concurrency:
group: "${{ needs.delete-gh-environment.outputs.environment_name }}-modify"
# TODO: replace with real destroy
steps:
- run: |
echo "Destroying the application in the cluster..."
echo "Namespace: ${{ github.event.repository.name }}-${{ needs.delete-gh-environment.outputs.environment_name }}"