Merge pull request #363 from bcgov/ASA-276/suitecrm-customization/rs #166
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: "[DEV/UAT] Advocase DEV/UAT Deployment" | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
on: | |
push: | |
branches: | |
- dev | |
- test | |
jobs: | |
##### SETUP ################################################################## | |
setup: | |
name: extract-branch-name | |
runs-on: ubuntu-latest | |
outputs: | |
environment: ${{ steps.parse.outputs.environment }} | |
image-tags: ${{ steps.parse.outputs.image-tags }} | |
steps: | |
- name: Extract branch name | |
id: parse | |
run: | | |
ENVIRONMENT=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | |
echo "environment=$ENVIRONMENT" >> $GITHUB_OUTPUT | |
echo "image-tags=$ENVIRONMENT" >> $GITHUB_OUTPUT | |
approve-deploy: | |
name: Approve Deploy | |
needs: setup | |
environment: ${{ needs.setup.outputs.environment }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deployment Approval | |
run: echo Approved | |
##### BUILD ################################################################## | |
bc-gov-advocase-image: | |
name: bc-gov-advocase-image | |
needs: [setup, approve-deploy] | |
uses: ./.github/workflows/reusable-build-dockerfile.yaml | |
with: | |
ref: ${{ needs.setup.outputs.environment }} | |
directory: docker/advocase-image | |
image-name: bc-gov-advocase | |
image-tags: ${{ needs.setup.outputs.image-tags }} | |
artifactory-repository: ad0d-advocase-docker | |
secrets: | |
artifactory-registry: ${{ secrets.ARTIFACTORY_REGISTRY }} | |
artifactory-username: ${{ secrets.ARTIFACTORY_USERNAME }} | |
artifactory-password: ${{ secrets.ARTIFACTORY_PASSWORD }} | |
##### DEPLOY ################################################################## | |
import-advocase-image-to-oc: | |
name: import-advocase-image-to-oc | |
needs: [setup, approve-deploy, bc-gov-advocase-image] | |
uses: ./.github/workflows/reusable-import-image-to-oc.yaml | |
with: | |
image-name: bc-gov-advocase | |
image-tags: ${{ needs.setup.outputs.image-tags }} | |
imagestream: artifactory-advocase | |
artifactory-repository: ad0d-advocase-docker | |
secrets: | |
artifactory-registry: ${{ secrets.ARTIFACTORY_REGISTRY }} | |
licence-plate: d0d1b5 | |
openshift-api: ${{ secrets.OPENSHIFT_API }} | |
token: ${{ secrets.OPENSHIFT_TOOLS_TOKEN }} | |
rollout-advocase-deployment: | |
name: rollout-advocase-deployment | |
needs: [setup, approve-deploy, import-advocase-image-to-oc] | |
uses: ./.github/workflows/reusable-rollout-deployment.yaml | |
with: | |
namespace: ${{ needs.setup.outputs.environment }} | |
secrets: | |
licence-plate: d0d1b5 | |
openshift-api: ${{ secrets.OPENSHIFT_API }} | |
token: ${{ secrets.OPENSHIFT_TOKEN }} | |
wait-for-rollout: | |
name: wait-for-rollout | |
needs: [setup, approve-deploy, rollout-advocase-deployment] | |
uses: ./.github/workflows/reusable-wait-for-rollout.yaml | |
with: | |
namespace: ${{ needs.setup.outputs.environment }} | |
secrets: | |
licence-plate: d0d1b5 | |
openshift-api: ${{ secrets.OPENSHIFT_API }} | |
token: ${{ secrets.OPENSHIFT_TOKEN }} | |
##### SCAN ################################################################## | |
# Removed from DEV/UAT workflow for performance reasons | |
# owasp-advocase: | |
# name: OWASP ZAP Scan | |
# needs: [setup, wait-for-rollout] | |
# runs-on: ubuntu-latest | |
# environment: ${{ needs.setup.outputs.environment }} | |
# steps: | |
# - name: OWASP ZAP Scan | |
# uses: zaproxy/[email protected] | |
# with: | |
# allow_issue_writing: false | |
# cmd_options: '-z "-config scanner.threadPerHost=20"' | |
# target: ${{ secrets.ZAP_ADVOCASE_URL }} | |
# - name: Upload Report as Artifact | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: OWASP ZAP Report | |
# path: report_html.html |