-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci)!: deploymentconfig deprecation (#244)
Co-authored-by: Derek Roberts <[email protected]>
- Loading branch information
1 parent
bdbcc5f
commit ea6a0c4
Showing
7 changed files
with
65 additions
and
170 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -4,8 +4,11 @@ on: | |
push: | ||
branches: [main] | ||
paths-ignore: | ||
- "**.md" | ||
workflow_dispatch: | ||
- '*.md' | ||
- '.github/**' | ||
- '.github/graphics/**' | ||
- '.github/ISSUE_TEMPLATE/**' | ||
- '!.github/workflows/**' | ||
|
||
env: | ||
DOMAIN: apps.silver.devops.gov.bc.ca | ||
|
@@ -16,8 +19,19 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
init: | ||
name: Initialize | ||
outputs: | ||
pr: ${{ steps.pr.outputs.pr }} | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
# Get PR number for squash merges to main | ||
- id: pr | ||
uses: bcgov-nr/[email protected] | ||
|
||
deploy-test: | ||
name: TEST Deployment | ||
needs: [init] | ||
runs-on: ubuntu-24.04 | ||
outputs: | ||
tag: ${{ steps.changelog.outputs.tag }} | ||
|
@@ -46,6 +60,7 @@ jobs: | |
-p ORACLEDB_SERVICENAME=${{ secrets.ORACLEDB_SERVICENAME }} | ||
-p ORACLEDB_SECRET=${{ secrets.ORACLEDB_SECRET }} | ||
-p ZONE=test | ||
-p TAG=${{ needs.init.outputs.pr }} | ||
|
||
- name: Publish API | ||
uses: bcgov-nr/[email protected] | ||
|
@@ -63,52 +78,9 @@ jobs: | |
reporters: '["cli"]' | ||
folder: '["general"]' | ||
|
||
- name: Conventional Changelog Update | ||
uses: TriPSs/conventional-changelog-action@v5 | ||
id: changelog | ||
continue-on-error: true | ||
with: | ||
github-token: ${{ github.token }} | ||
output-file: "CHANGELOG.md" | ||
skip-version-file: "true" | ||
skip-commit: "true" | ||
git-push: "true" | ||
|
||
- name: Create Release | ||
uses: softprops/action-gh-release@v2 | ||
if: ${{ steps.changelog.outputs.tag != '' }} | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
token: ${{ github.token }} | ||
tag_name: ${{ steps.changelog.outputs.tag }} | ||
name: ${{ steps.changelog.outputs.tag }} | ||
body: ${{ steps.changelog.outputs.clean_changelog }} | ||
|
||
image-promotions: | ||
name: Image Promotions | ||
needs: [deploy-test] | ||
runs-on: ubuntu-24.04 | ||
strategy: | ||
matrix: | ||
tag: [prod, "${{ needs.deploy-test.outputs.tag }}"] | ||
steps: | ||
- name: Promoting API | ||
if: ${{ matrix.tag != '' }} | ||
uses: shrink/actions-docker-registry-tag@v4 | ||
with: | ||
registry: ghcr.io | ||
repository: ${{ github.repository }}/api | ||
target: test | ||
tags: ${{ matrix.tag }} | ||
|
||
- name: Promoting API | ||
if: ${{ matrix.tag == '' }} | ||
run: echo "Tag is empty, promotion step skipped" | ||
|
||
deploy-prod: | ||
name: PROD Deployment | ||
needs: [image-promotions] | ||
needs: [deploy-test, init] | ||
runs-on: ubuntu-24.04 | ||
environment: | ||
name: prod | ||
|
@@ -133,6 +105,7 @@ jobs: | |
-p ORACLEDB_SERVICENAME=${{ secrets.ORACLEDB_SERVICENAME }} | ||
-p ORACLEDB_SECRET=${{ secrets.ORACLEDB_SECRET }} | ||
-p ZONE=prod | ||
-p TAG=${{ needs.init.outputs.pr }} | ||
|
||
- name: Publish API | ||
uses: bcgov-nr/[email protected] | ||
|
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 |
---|---|---|
|
@@ -2,54 +2,25 @@ name: Pull Request Close | |
|
||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
NAME: ${{ github.event.repository.name }} | ||
types: [closed] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.number }} | ||
# PR open and close use the same group, allowing only one at a time | ||
group: ${{ github.event.number }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
# Clean up OpenShift when PR closed, no conditions | ||
cleanup-openshift: | ||
name: Cleanup OpenShift | ||
runs-on: ubuntu-24.04 | ||
environment: | ||
name: dev | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install CLI tools from OpenShift Mirror | ||
uses: redhat-actions/openshift-tools-installer@v1 | ||
with: | ||
oc: "4.13" | ||
|
||
- name: Remove OpenShift artifacts | ||
run: | | ||
oc login --token=${{ secrets.OC_TOKEN }} --server=${{ secrets.OC_SERVER }} | ||
oc project ${{ secrets.OC_NAMESPACE }} | ||
# Remove old build runs, build pods and deployment pods | ||
oc delete all,pvc,secret -l app=${{ env.NAME }}-${{ github.event.number }} | ||
# If merged into main, then handle any image promotions | ||
image-promotions: | ||
name: Image Promotions | ||
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Promoting API | ||
uses: shrink/actions-docker-registry-tag@v4 | ||
with: | ||
registry: ghcr.io | ||
repository: ${{ github.repository }}/api | ||
target: ${{ github.event.number }} | ||
tags: test | ||
|
||
cleanup: | ||
name: Cleanup and Images | ||
uses: bcgov/quickstart-openshift-helpers/.github/workflows/[email protected] | ||
secrets: | ||
oc_namespace: ${{ secrets.OC_NAMESPACE }} | ||
oc_token: ${{ secrets.OC_TOKEN }} | ||
with: | ||
cleanup: label | ||
environment: dev | ||
packages: api | ||
|
||
# Notify when PR merged and branch = main | ||
merge-notification: | ||
name: Merge Notification | ||
runs-on: ubuntu-24.04 | ||
|
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 |
---|---|---|
|
@@ -74,12 +74,14 @@ jobs: | |
Thanks for the PR! | ||
Any successful deployments (not always required) will be available below. | ||
[API](https://${{ github.event.repository.name }}-${{ github.event.number }}-backend.${{ env.DOMAIN }}/) available | ||
[API](https://${{ github.event.repository.name }}-${{ github.event.number }}-api.${{ env.DOMAIN }}/) available | ||
Once merged, code will be promoted and handed off to following workflow run. | ||
[Main Merge Workflow](https://github.com/${{ github.repository }}/actions/workflows/merge-main.yml) | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
|
@@ -97,16 +99,13 @@ jobs: | |
build_file: Dockerfile | ||
build_args: | | ||
APP_VERSION=${{ needs.pr-validation.outputs.semver }}-${{ github.event.number }} | ||
deploy: | ||
name: Deploy | ||
needs: [build] | ||
runs-on: ubuntu-24.04 | ||
timeout-minutes: 15 | ||
environment: | ||
name: dev | ||
environment: dev | ||
steps: | ||
- name: Deploys | ||
uses: bcgov-nr/[email protected] | ||
|
@@ -126,6 +125,7 @@ jobs: | |
-p ORACLEDB_SERVICENAME=${{ secrets.ORACLEDB_SERVICENAME }} | ||
-p ORACLEDB_SECRET=${{ secrets.ORACLEDB_SECRET }} | ||
-p ZONE=${{ github.event.number }} | ||
-p TAG=${{ github.event.number }} | ||
|
||
- name: Deploy dev route | ||
uses: bcgov-nr/[email protected] | ||
|
@@ -142,8 +142,7 @@ jobs: | |
postman: | ||
name: Smoke Test | ||
needs: [deploy] | ||
environment: | ||
name: dev | ||
environment: dev | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
|
@@ -156,15 +155,15 @@ jobs: | |
uses: matt-ball/newman-action@master | ||
with: | ||
collection: postman/FCA.postman_collection.json | ||
envVar: '[{"key":"URL_FCA","value":"https://${{ github.event.repository.name }}-${{ github.event.number }}-backend.${{ env.DOMAIN }}"}]' | ||
envVar: '[{"key":"URL_FCA","value":"https://${{ github.event.repository.name }}-${{ github.event.number }}-api.${{ env.DOMAIN }}"}]' | ||
reporters: '["cli"]' | ||
folder: '["general"]' | ||
|
||
- name: Postman Smoke Test | ||
uses: matt-ball/newman-action@master | ||
with: | ||
collection: postman/FCA.postman_collection.json | ||
envVar: '[{"key":"URL_FCA","value":"https://${{ github.event.repository.name }}-${{ github.event.number }}-backend.${{ env.DOMAIN }}"}]' | ||
envVar: '[{"key":"URL_FCA","value":"https://${{ github.event.repository.name }}-${{ github.event.number }}-api.${{ env.DOMAIN }}"}]' | ||
iterationData: postman/FCA_postman_tests_dev.json | ||
reporters: '["cli", "junit"]' | ||
reporter: '{ "junit" : { "export" : "./postman/report.xml" } }' | ||
|
Oops, something went wrong.