iCR Workflow Integration Guide
WebTry iCR
Release 2.1.0
Release 2.1.0
  • Table of contents
    • Introduction
    • Jenkins Workflow
      • Installing the plugin
      • Configuring the plugin
        • Creating a Personal Access Token
        • Copying Your Repository's URL
      • Viewing the Results
    • GitHub Actions Workflow
      • Workflow Overview
      • Preparing and Registering the Docker Image
        • Adding a Workflow to a Repository
      • Preparing the GitHub Workflow
        • Environment Variables
        • User Supplied Secrets
        • Setting the User Defined Secrets Values
      • Executing the Workflow
    • GitLab Workflow
      • Workflow Overview
      • Preparing the Docker Image
        • Registering the Docker Image
      • Configuring the GitLab Script variables
        • Environment Variables
        • User Supplied Variables
        • Creating a Personal Access Token
        • Setting the User Defined Variable Values
      • Executing the Workflow
    • Multiple Workflows
    • Appendix A - Getting a BitBucket App Password for JENKINS
Powered by GitBook
On this page

Was this helpful?

  1. Table of contents
  2. GitHub Actions Workflow

Preparing the GitHub Workflow

PreviousAdding a Workflow to a RepositoryNextEnvironment Variables

Last updated 2 years ago

Was this helpful?

To trigger a workflow in GitHub CI/CD, a special yml script to invoke the container must be inserted into the project’s repository. This script MUST be placed in the .github directory at the top level of the repository. If it is not already present, a subdirectory named workflows must be created. Then, within the workflows directory, a yml script describing the bahviour of the workflow is placed. This script is triggered upon events specified in the script.

OpenRefactory supplies a sample script for use with GitHub CI/CD. It triggers upon the occurrence of push or pull requests but the DevOps engineer preparing the workflow can create whatever triggers are appropriate for their specific needs. This script can be incorporated into a previous workflow script or edited to make the workflow operate as needed.

We won’t cover how to add a file to a GitHub repository as that is beyond the scope of this User Guide.

For our example, we are using the baritone project. We go to the main repository page for this project and look at the .github/workflows directory:

We have copied the sample githubAction.yml script there. Let’s quickly review the sample script:

# This is a basic workflow to help you get started with iCR CI/CD

name: Openrefactory_CI

# Controls when the workflow will run
on:
  # Triggers the workflow on push or pull request events but only for the "master" branch
  push:
    branches: [ "master" ]
    
env:
  REGISTRY: ghcr.io

jobs:
  OR_JOB:
    runs-on: ubuntu-18.04
    container:
            image: ghcr.io/or-testuser/icr-github:latest
    steps:
      - uses: actions/checkout@v2
      - name: orjob
        run: |
          /workspace/configure_run.sh ${{ github.ref_name }}
          ${{github.repositoryUrl }}
          ${{ secrets.ICR_URL }}
          ${{ secrets.ICR_PASSPHRASE }}
          ${{ secrets.PERSONAL_ACCESS_TOKEN }}
          ${{ secrets.MAIL_ADDRESS }}
          ${{ secrets.LANGUAGE_VERSION }}
        shell: bash

The critical items of interest are the variables referenced in the run: step. They are needed to be able to locate the targeted iCR server and to provide the Navigator with the information required so it can authenticate itself with the proper username and identify the project and branch name.

There are seven variables in the script. Let’s look at all of them. They are broken into 2 groups: preconfigured environment variables and user supplied secret values.

In this sample script, the on: section specifies what will trigger the execution of this script. In this example, whenever a commit is pushed to the master branch, it will be executed. The registry where the package is registered is identified as ghcr.io as specified in the .

GitHub documentation