Skip to content

About

Consolidated repo for bcgov-specific openshift actions. Please feel free to contribute!

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

actions-openshift

Consolidated repo for bcgov-specific openshift actions. Please feel free to contribute!

Unknown inputs

Every action fails at its first step when a caller passes an input it does not declare (GitHub on its own only warns), naming the key and listing the declared inputs. The check is the bcgov/actions input-enforcer action, pinned by SHA like diff-triggers.

Workflows and Actions

1. PR Cleanup (Composite Action)

Cleans up Helm releases, labeled resources, and PVCs in a target OpenShift namespace on pull request close or merge.

2. PR Environment Cleanup (Composite Action)

Scheduled sweep that cleans up closed or inactive PR OpenShift deployments (by app label) and/or app-<pr> users/databases in a shared Crunchy PostgresCluster.

3. cert-keeper (Composite Action)

Keeps a host's SSL/TLS certificate valid on an OpenShift Route: gets a free Let's Encrypt certificate when the host has none or is running low (or installs a pre-supplied certificate from tls_certificate / tls_private_key / tls_ca_certificate), installs it on the Route, and cleans up.

  • See cert-keeper/README.md for the daily workflow, pre-supplied certificate inputs, how it decides, and rate limits.

4. Image Import (Composite Action)

Imports one GHCR image into a namespace ImageStream (referencePolicy: Local, importMode: PreserveOriginal) and checks the imported digest against GHCR.

- uses: bcgov/actions-openshift/image-import@vX.Y.Z
  with:
    image: ${{ steps.build.outputs.registry_host }}${{ steps.build.outputs.image_path }}
    oc_namespace: ${{ secrets.OC_NAMESPACE }}
    oc_server: ${{ vars.OC_SERVER }}
    oc_token: ${{ secrets.OC_TOKEN }}

5. oc-runner (Composite Action)

Login and run oc commands (and optional cronjobs) on OpenShift.

- uses: bcgov/actions-openshift/oc-runner@vX.Y.Z
  with:
    oc_namespace: ${{ vars.oc_namespace }}
    oc_server: ${{ vars.oc_server }}
    oc_token: ${{ secrets.OC_TOKEN }}
    commands: oc whoami

6. deployer (Composite Action)

Deploy to OpenShift using templates. Verification or penetration tests.

- uses: bcgov/actions-openshift/deployer@vX.Y.Z

7. sysdig-monitor (Composite Action)

Create/update Sysdig email alerts for an OpenShift app on PROD deploy.

- uses: bcgov/actions-openshift/sysdig-monitor@vX.Y.Z
  with:
    sysdig_api_token: ${{ secrets.SYSDIG_API_TOKEN }}
    oc_namespace: ${{ secrets.OC_NAMESPACE }}
    app: my-app

8. SchemaSpy (.github/workflows/.schema-spy.yml)

A reusable workflow that spins up a Postgres/PostGIS service, runs migrations using Flyway, generates interactive database documentation with SchemaSpy, and automatically publishes the results to GitHub Pages.

Example Usage:

jobs:
  document-db:
    uses: bcgov/actions-openshift/.github/workflows/.schema-spy.yml@vX.Y.Z
    permissions:
      contents: write
    with:
      db_name: app_database
      deploy_dir: docs/schema

9. Runner reachability records (.github/workflows/probe-runner-*.yml)

Internal records of whether GitHub-hosted runner IPs can reach the OpenShift APIs (background: #49). Nothing alerts on blocked runners; the runs stay green.

  • probe-runner-reachability.yml runs every 6 hours, probes the gold and silver APIs (:6443) and the silver router (:443) from 20 runners, writes a table to the run summary and uploads a probe-results JSON artifact (kept 14 days). A blocked runner is a warning; the run fails only when samples are missing, and then skips the upload so an earlier, complete record is kept.
  • probe-runner-report.yml runs weekly and summarizes the past 14 days of probe-results: this week vs last week, block rate per /24 runner IP range (always, sometimes or never blocked), and the gold vs silver split.

Operational Scripts

Standalone CLI utilities that a person runs with their own login (certificate management, deployment renames, Postgres transfers and comparisons, rights reports) now live in bcgov/devops-scripts:

  • Certificate management: cert/
  • OpenShift & database operations, including the Postgres migration walkthrough: oc/

About

Consolidated repo for bcgov-specific openshift actions. Please feel free to contribute!

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages