Skip to content

Commit

Permalink
Making workflow changes to support deployment as per 14.4.6 version
Browse files Browse the repository at this point in the history
Signed-off-by: Rajpal Chauhan <[email protected]>
  • Loading branch information
rajpalc7 committed Jan 15, 2024
1 parent ac44431 commit 53893c1
Showing 1 changed file with 33 additions and 4 deletions.
37 changes: 33 additions & 4 deletions .github/workflows/actions/deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ runs:
username: ${{ github.actor }}
password: ${{ inputs.ghcr_token }}

- name: Install CLI tools from OpenShift Mirror
uses: redhat-actions/openshift-tools-installer@v1
with:

# "mirror" is the default source, so this is optional.
source: "mirror"

# Installs the latest release of oc with the major version 3.
# This is equivalent to "3.x" or "^3".
oc: "4.14.6"

- name: Setup Openshift CLI
uses: redhat-actions/oc-login@v1
with:
Expand All @@ -58,8 +69,26 @@ runs:
- name: Login in to OpenShift container registry
shell: bash
run: |
oc registry login
oc version
docker version
# Openshift pipeline is currently running on 14.4.6 version and according to
# the new red hat article - https://access.redhat.com/articles/7042033
# the Podman auth configuration locations are preferred over Docker configuration locations.
# In order to avoid the "unauthorized: authentication required error" and
# make github actions job run successfully make sure when we try to login to openshift registry
# we need to define the oc registry login --to="${HOME}/.docker/config.json" in the oc login action step.
# This was not an issue when Openshift pipeline was running on 14.2 or 14.3 version
# but since Openshift upgraded to 14.4 version it started giving warning
# message : the default reading order of registry auth file will be changed from "${HOME}/.docker/config.json"
# to podman registry config locations in the future version of oc.
# "${HOME}/.docker/config.json" is deprecated, but can still be used for storing credentials
# as a fallback. See https://github.com/containers/image/blob/main/docs/containers-auth.json.5.md for the order
# of podman registry config locations.
oc registry login --to="${HOME}/.docker/config.json"
- name: Tag the image in the GHCR as ${{ inputs.environment }}
shell: bash
run: |
Expand All @@ -72,7 +101,7 @@ runs:
run: |
docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }}
docker tag ${{ inputs.github_image_name }}@${{ inputs.image_digest }} ${{ inputs.openshift_image_name }}:${{ inputs.environment }}
docker push ${{ inputs.openshift_image_name }}:${{ inputs.environment }}
docker --debug --log-level=debug push ${{ inputs.openshift_image_name }}:${{ inputs.environment }}
- name: Trigger OpenShift rollout
shell: bash
Expand All @@ -88,6 +117,6 @@ runs:
job_name: '*Deployment to ${{ inputs.environment }}*'
mention: 'here'
mention_if: 'failure'
channel: '#test-gha'
channel: '#ditp-gha-notifications'
url: ${{ inputs.rocketchat_webhook }}
commit: true
commit: true

0 comments on commit 53893c1

Please sign in to comment.