forked from alexey-ban/ai-dial-chat-themes
-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (48 loc) · 1.56 KB
/
pr-env.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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 }}"