Skip to content

Undeploy PR-12345

Undeploy PR-12345 #69

Workflow file for this run

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: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.14"
- 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 }}