do not merge - For testing: added workflows to delete images and deployment #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Delete Closed PR jobs | |
on: | |
pull_request: | |
branches: | |
- main | |
types: | |
- closed | |
jobs: | |
uninstall: | |
name: Uninstall PR | |
environment: development | |
runs-on: ubuntu-20.04 | |
if: github.repository_owner == 'bcgov' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Authenticate and set context | |
uses: redhat-actions/oc-login@v1 | |
with: | |
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }} | |
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} | |
namespace: ${{ secrets.OPENSHIFT_NAMESPACE }} | |
- name: Unistall Traction PR Helm | |
run: | | |
helm uninstall pr-${{ github.event.number }}-traction | |
- name: Remove Traction Openshift Objects | |
continue-on-error: true | |
run: | | |
oc delete all,secret,pod,networkpolicy,configmap,pvc --selector "app.kubernetes.io/instance"=pr-${{ github.event.number }}-traction | |
clean-ghcr: | |
runs-on: ubuntu-20.04 | |
name: Delete closed or stale pr images | |
steps: | |
- name: Delete containers | |
uses: snok/container-retention-policy@v2 | |
with: | |
image-names: traction-plugins-acapy, traction-tenant-proxy, traction-tenant-ui | |
cut-off: One month ago UTC | |
account-type: org | |
org-name: ${{ github.repository_owner}} | |
filter-tags: ${{ github.event.number }} | |
token: ${{ secrets.PACKAGE_DELETE_TOKEN }} |