Skip to content

Add GitHub Actions workflow to build and deploy plugin to OMCSI #84

Description

@dmccoystephenson

Summary

Add a .github/workflows/deploy.yml file that automatically builds the plugin JAR and deploys it to the omcsi (open-mc-server-infrastructure) instance when changes are pushed to the deploy branch.

Implementation

Create .github/workflows/deploy.yml modeled after the Activity Tracker reference workflow with the following adjustments for this project:

  • JDK version: [8 / 11 / 17 / 21]
  • Build tool & command:
    • Maven: mvn --batch-mode package
    • Gradle: ./gradlew build
  • JAR location:
    • Maven: target/ (exclude original-*, *-sources.jar, *-javadoc.jar)
    • Gradle: build/libs/ (exclude *-sources.jar, *-javadoc.jar)

Required Secrets

Add via repo Settings → Secrets and variables → Actions:

Secret Value
OMCSI_DEPLOY_URL Base URL of the omcsi instance, e.g. https://mc.example.com:8092
OMCSI_DEPLOY_TOKEN Value of DEPLOY_AUTH_TOKEN from the omcsi .env file

Required Variables

Add via repo Settings → Secrets and variables → Actions → Variables:

Variable Value
PLUGIN_JAR_NAME Filename of the JAR on the server, e.g. MyPlugin.jar
DEPLOY_BRANCH Branch that triggers deploys (default: main)

Acceptance Criteria

  • .github/workflows/deploy.yml exists in the repo
  • Pushing to the deploy branch triggers a build and successful deploy
  • Workflow can also be triggered manually via the Actions tab (workflow_dispatch)
  • Failed builds, missing variables, auth errors, and bad requests all produce a clear error message and non-zero exit code
  • Secrets and variables documented in this ticket are configured in the repo

Reference

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions