Skip to content

Setup CICD pipeline for the framework #5

Description

@yn-huang

Summary

Setup a CI/CD pipeline with GitHub Actions. Every pull request should build, test and preview on Netlify, and every merge to main should deploy automatically to Cloudapps Openshift through the existing Apache (httpd) S2I build.

How it works

On pull requests (into any branch)

  1. Install dependencies (npm ci, including @tis-lab packages from GitHub Packages), lint, test and build
  2. Smoke test: build the output with the same httpd S2I image OpenShift uses (httpd:2.4-el7) and check that Apache serves it.
  3. Deploy a Netlify preview and post the link as a PR comment (pr-<number>--<site>.netlify.app). New pushes update the same comment.

On merge to main

  1. Same build, test and smoke test.
  2. Commit the new build output to framework/build (only if it changed).
  3. Call the OpenShift BuildConfig's generic webhook. OpenShift builds that exact commit and the Deployment rolls out automatically.

No OpenShift login token is stored in GitHub. The webhook URL can only trigger a build.

Workflow file: .github/workflows/deploy-openshift.yml

Blockers / open questions

  • Blocked by Standardize the UI toolchain on npm and fix dependency classification study-palette#50. Once this PR is merged, need to republish the package @tis-lab/study-palette-ui. Because framework currently returns 403 error running npm ci locally due to no availability. (not found in tis-lab packages)
  • Team convention: only the pipeline commits framework/build. Discard local build changes before committing (git restore framework/build) to avoid merge conflicts.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions