-
Notifications
You must be signed in to change notification settings - Fork 398
79 lines (66 loc) · 2.86 KB
/
cleanup-branch.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# # Cleans up infrastructure & artifacts. Manually & when branch gets deleted
# # Note: the workflow_dispatch & schedule events will only trigger if the workflow
# # file is on the default (main) branch.
# # See:
# # https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch
# # https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
# # https://docs.github.com/en/actions/reference/events-that-trigger-workflows#schedule
# name: financial-demo cleanup-branch
# on:
# workflow_dispatch:
# delete:
# env:
# # Keep these values in sync with the values in the Makefile
# AWS_REGION: us-west-2
# AWS_ECR_URI: 024629701212.dkr.ecr.us-west-2.amazonaws.com
# AWS_ECR_REPOSITORY: financial-demo
# AWS_S3_BUCKET_NAME: rasa-financial-demo
# jobs:
# cleanup_deleted_branch:
# if: github.event.ref_type == 'branch'
# name: cleanup_deleted_branch
# runs-on: ubuntu-latest
# steps:
# - name: checkout
# uses: actions/checkout@v2
# - name: Set up Python 3.7
# uses: actions/setup-python@v2
# with:
# python-version: 3.7
# - name: Cache pip
# # see: https://docs.github.com/en/actions/guides/building-and-testing-python#caching-dependencies
# uses: actions/cache@v2
# with:
# path: ~/.cache/pip
# key: ${{ runner.os }}-pip-${{ hashFiles('requirements-dev.txt') }}
# restore-keys: |
# ${{ runner.os }}-pip-
# ${{ runner.os }}-
# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v1
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: ${{ env.AWS_REGION }}
# - name: install CLIs & dependencies
# run: |
# make install-eksctl
# make install-kubectl
# make install-helm
# make install-jp
# - name: Cleanup ECR
# run: |
# echo "Delete action server image of branch ${{ github.event.ref }}"
# make aws-ecr-docker-login
# make aws-ecr-delete-image GIT_BRANCH_NAME=${{ github.event.ref }}
# - name: Cleanup S3
# run: |
# echo "Delete rasa model of branch ${{ github.event.ref }}"
# make aws-s3-delete-rasa-model GIT_BRANCH_NAME=${{ github.event.ref }}
# - name: Cleanup EKS & all Persistent Volume Claims / Persistent Volumes
# run: |
# echo "Delete test cluster of branch ${{ github.event.ref }} and PVCs"
# make aws-eks-cluster-update-kubeconfig GIT_BRANCH_NAME=${{ github.event.ref }}
# make rasa-enterprise-uninstall
# make rasa-enterprise-delete-pvc-all
# make aws-eks-cluster-delete GIT_BRANCH_NAME=${{ github.event.ref }}