From 4987ca29602852b55e9c91c80a074402d489b88a Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Thu, 26 Sep 2024 16:43:16 -0700 Subject: [PATCH] chore(ci): use official RH oc setup action (#91) Co-authored-by: Paulo Gomes da Cruz Junior --- .github/workflows/pr-closed.yml | 5 +++++ .github/workflows/pr-open.yml | 4 ++-- README.md | 8 ++++---- action.yml | 14 ++++---------- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pr-closed.yml b/.github/workflows/pr-closed.yml index 8e9cb20..48db815 100644 --- a/.github/workflows/pr-closed.yml +++ b/.github/workflows/pr-closed.yml @@ -18,6 +18,11 @@ jobs: runs-on: ubuntu-24.04 timeout-minutes: 10 steps: + - name: Install CLI tools from OpenShift Mirror + uses: redhat-actions/openshift-tools-installer@v1 + with: + oc: "4" + - name: Remove OpenShift artifacts run: | oc login --token=${{ secrets.OC_TOKEN }} --server=${{ vars.OC_SERVER }} diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 0d13df0..15e1787 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -9,7 +9,7 @@ concurrency: jobs: deploys: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 timeout-minutes: 10 outputs: backend: ${{ steps.trigger.outputs.backend }} @@ -51,7 +51,7 @@ jobs: results: name: Results - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: [deploys] steps: - run: | diff --git a/README.md b/README.md index e953ea8..6517156 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ Deploy a single template. Multiple GitHub secrets are used. ```yaml deploys: name: Deploys - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Deploys uses: bcgov-nr/action-deployer-openshift.yml@main @@ -126,7 +126,7 @@ Deploy multiple templates in parallel. Runs on pull requests (PRs). ```yaml deploys: name: Deploys -runs-on: ubuntu-latest +runs-on: ubuntu-24.04 strategy: matrix: name: [backend, database, frontend, init] @@ -170,7 +170,7 @@ Deploy and run a command (post hook). Matrix values reference `post_rollout`, ` ```yaml deploys: name: Deploys -runs-on: ubuntu-latest +runs-on: ubuntu-24.04 strategy: matrix: name: [database, frontend] @@ -205,7 +205,7 @@ Deploy a template and set the after deployment check to hit the **/health** endp ```yaml deploys: name: Deploys - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Deploys uses: bcgov-nr/action-deployer-openshift.yml@main diff --git a/action.yml b/action.yml index 2cb860a..f8842d7 100644 --- a/action.yml +++ b/action.yml @@ -105,16 +105,10 @@ runs: diff_branch: ${{ inputs.diff_branch }} # Override OpenShift version, if specified - - name: Override OpenShift version - if: ${{ inputs.oc_version }} - env: - OC: https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-${{ inputs.oc_version }}/openshift-client-linux.tar.gz - shell: bash - working-directory: /usr/local/bin/ - run: | - # Override default OpenShift version (retry, resume) - (wget ${{ env.OC }} -qcO - | tar -xzvf - oc)|| !! - oc version + - name: Install CLI tools from OpenShift Mirror + uses: redhat-actions/openshift-tools-installer@v1 + with: + oc: ${{ inputs.oc_version || '4' }} # Process variables and inputs # Remote/override repo is required if one has been specified (input)