forked from bcgov/common-hosted-form-service
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (39 loc) · 1.34 KB
/
pr_undeploy.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
name: PR Undeploy
run-name: Undeploy PR-${{ github.event.inputs.pr-number }}
env:
ACRONYM: chefs
on:
workflow_dispatch:
inputs:
pr-number:
description: Pull request number
required: true
type: string
jobs:
remove-pr-dev:
name: Remove PR build from dev namespace
environment:
name: pr
runs-on: ubuntu-latest
timeout-minutes: 12
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to OpenShift Cluster
uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }}
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
insecure_skip_tls_verify: true
namespace: ${{ vars.NAMESPACE_PREFIX }}-dev
- name: Remove PR Deployment
shell: bash
run: |
oc delete -n ${{ vars.NAMESPACE_PREFIX }}-dev all,secret,networkpolicy,rolebinding --selector app=${{ env.ACRONYM }}-pr-${{ github.event.inputs.pr-number }}
oc delete -n ${{ vars.NAMESPACE_PREFIX }}-dev all,svc,cm,sa,role,secret --selector cluster-name=pr-${{ github.event.inputs.pr-number }}
- name: Remove Release Comment on PR
uses: marocchino/sticky-pull-request-comment@v2
with:
header: release
delete: true
number: ${{ github.event.inputs.pr-number }}