-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Github Actions Continuous Delivery pipeline
Signed-off-by: Jeremy Ho <[email protected]>
- Loading branch information
Showing
13 changed files
with
244 additions
and
131 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Pull Request Closed | ||
|
||
env: | ||
ACRONYM: ches | ||
APP_NAME: common-hosted-email-service | ||
NAMESPACE_PREFIX: b160aa | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
types: | ||
- closed | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
remove-pr-dev: | ||
name: Remove PR build from dev namespace | ||
if: "! github.event.pull_request.head.repo.fork" | ||
environment: | ||
name: pr | ||
url: https://${{ env.ACRONYM }}-dev-pr-${{ github.event.number }}.apps.silver.devops.gov.bc.ca | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 12 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- 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: ${{ env.NAMESPACE_PREFIX }}-dev | ||
- name: Remove PR Deployment | ||
shell: bash | ||
run: | | ||
oc delete --namespace ${{ env.NAMESPACE_PREFIX }}-dev all,secret,pvc,networkpolicy,rolebinding --selector app=${{ env.ACRONYM }}-pr-${{ github.event.number }} | ||
oc delete --namespace ${{ env.NAMESPACE_PREFIX }}-dev all,svc,cm,sa,role,secret --selector cluster-name=pr-${{ github.event.number }} | ||
oc delete --namespace ${{ env.NAMESPACE_PREFIX }}-dev all --selector app=redis-pr-${{ github.event.number }} | ||
- name: Remove Release Comment on PR | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
header: release | ||
delete: true | ||
- name: Remove Github Deployment Environment | ||
uses: strumwolf/delete-deployment-environment@v2 | ||
with: | ||
environment: pr | ||
onlyRemoveDeployments: true | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.