-
Notifications
You must be signed in to change notification settings - Fork 6
58 lines (46 loc) · 1.86 KB
/
cloud_demo_environment_deprovisioning.yaml
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
name: Cloud Demo Environment De-Provisioning
on:
workflow_dispatch:
inputs:
name:
description: 'User alias or LD env key'
required: true
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
ECR_REPOSITORY: ld-core-demo
KUBECTL_VERSION: "v1.23.0"
DEMO_NAMESPACE: ${{ github.event.inputs.name }}
jobs:
deploy-to-demoenv:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install LaunchDarkly CLI
run: npm install -g @launchdarkly/ldcli
- name: Set LaunchDarkly Production CLI Config
run: |
echo "Setting up LaunchDarkly CLI for LD Production Account"
ldcli config --set access-token ${{ secrets.LD_API_KEY }}
- name: Remove Demo Environment from LD Production Account
run: |
ldcli projects delete --project ${{ env.DEMO_NAMESPACE }}-ld-demo
- name: Set LaunchDarkly EAP CLI Config
run: |
echo "Setting up LaunchDarkly CLI for LD EAP Account"
ldcli config --set access-token ${{ secrets.LD_EAP_API_KEY }}
- name: Remove Demo Environment from LD EAP Account
run: |
ldcli projects delete --project ${{ env.DEMO_NAMESPACE }}-ld-demo
- name: Check Namespace in Kubernetes
uses: kodermax/kubectl-aws-eks@master
with:
args: get namespace ${{ env.DEMO_NAMESPACE }} &>/dev/null && echo "namespace_exists=true" >> $GITHUB_ENV || echo "namespace_exists=false" >> $GITHUB_ENV
- name: Delete Kubernetes Namespace
if: env.namespace_exists == 'true'
uses: kodermax/kubectl-aws-eks@master
with:
args: delete namespace ${{ env.DEMO_NAMESPACE }}