Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
mayurbelur_mohan
Product and Topic Expert
Product and Topic Expert
1,767

Github Actions provides a way to Automate, customize, and execute your software development workflows right in your Github repository. 

Github Actions is a continuous integration and continuous delivery (CI/CD) platform that automates build, test, and deployment pipelines. It also allows you to execute code in the repository when certain events occur, making it easy to extend and customize.

 In this Blog we will showcase how to build GitHub Actions Workflow for deploying the integration flow using Integration Suite Piper Commands.

A workflow is a series of actions initiated once a triggering event occurs. For example, the triggering event can be some commit pushed to a GitHub repository, the creation of a pull request etc.

The set of instructions for a workflow is kept in a workflow file and written in YAML. The workflow file specifies what commands or scripts to run, the default settings, the environment for the commands, etc. 

The workflow is divided into jobs, and each job performs a set of steps. Each step runs one or more commands and can also call self-contained units of commands called actions. Each step runs on computational resources called runners, and the default settings can specify it to be Windows or Linux.

Lets build a workflow which deploy the integration flow in to the SAP Cloud integration Tenant

Create a Workflow

1. Create a repository and name it .github/workflows inside the GitHub repository GithubActionsDemo. 

mayurbelur_mohan_0-1707703786309.png

2. Create a yml file and name it iflowDeploy.yml.mayurbelur_mohan_1-1707703955894.png

 

 

3. Paste the following code inside the iflowDeploy.yml file.

 

name: SAP Cloud Integration deploy IFlow Test
on:
  push:
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: integrationArtifactDeploy
        uses: SAP/project-piper-action@main
        with:
          step-name: integrationArtifactDeploy
          flags: --apiServiceKey ${{ secrets.CPIAPISERVICEKEYCREDENTIALSID }} --integrationFlowId PurchaseOrderHandlerDemo

 

4. Copy the SAP Cloud Integration Service Key for API Plan from SAP BTP Cockpitmayurbelur_mohan_2-1707704627717.png

5. Copy the JSON Content to the Text Editor and remove line breaks and spaces. make complete JSON appear in single line without any such line breaks or spaces.

For example: {"oauth":{"createdate":"2022-11-02T09:48:13.398Z","clientid":"sb-47bbf5d2-d764-45d7-ba46-d6bd540cc4c6!b17976|it!b2455","url":"https://XXX.it-cpi999.cfapps.us10.hana.ondemand.com","clientsecret":"c52bbcff-ca23-4f90-b01f-73b0f552ebb6$fXqdreVaI13WTn8cdgXNW5Tt83RfvFg9pyVYBAVz8WI=","tokenurl":"https://XXX.authentication.usXX.hana.ondemand.com/oauth/token"}}

6. Create repository secret and save above content by name CPIAPISERVICEKEYCREDENTIALSID 

mayurbelur_mohan_3-1707705186409.png

Test Workflow

To test the workflow in the committed workflow file:

  1. Since our workflow’s trigger is a push event, push a commit on this repository branch via directly editing report content or from Git tool.
  2. Go to the repository’s page on GitHub and click the Actions tab under the repository’s name.
  3. At the top, the commit message for the push that triggered the workflow will be visible.

     

    mayurbelur_mohan_5-1707705541189.png

     

  4. Once the workflow is complete, click on the tab with the commit message. In this case, click on "Update Readme.txt"
  5. The job name and status will appear on right side mayurbelur_mohan_6-1707705735096.png

     

     
  6. Clicking on the job will show the output from each step in the workflow.

mayurbelur_mohan_7-1707705946064.png

From the results you can see that integrationArtifactDeploy piper command successfully executed. 

7. Verify the integration flow deployment in to SAP Cloud integration Tenant 

  As you see below  integration flow PurchaseOrderHandlerDemo deployed in to SAP Cloud integration tenant runtime. 

mayurbelur_mohan_8-1707706208706.png

In this way you can use any of the Integration Suite piper commands referred in my earlier blog in the GitHub Actions project and implement you own CI/CD pipelines.