API Connect

What's New - API Connect toolkit with GitHub Actions - re-usable step

By Ricky Moorhouse posted Wed March 31, 2021 06:40 AM

  

As I wrote in my previous post combining API Connect and GitHub actions , you can easily build a continuous deployment set up for your APIs with GitHub actions to automate the API publishing when you push a new commit to your git repo.  I’ve now extended this into a re-usable action that anyone can use within their GitHub Actions by simply point to it in the steps like this:

on: [push]

jobs:
apic-deploy-test:
runs-on: ubuntu-latest
name: APIC deployment
steps:
- uses: actions/checkout@v2
- uses: rickymoorhouse/apic-deploy@v3
with:
manager-host: {{ manager hostname }}
api-host: {{ platform api hostname }}
provider-org: {{ provider org name }}
catalog: {{ catalog name }}
iam-apikey: {{ IBM Cloud IAM apikey }}
product-file: {{ product file to publish }}

 

You can see this in my test deploy repo. This is still very much a work in progress and has been written and tested API Connect Reserved Instance making use of an IBM Cloud IAM API key, but should work with username, password and realm parameters instead e.g.

        username: {{ API Connect username }}
        password: {{ API Connect password }}
        realm: {{ Realm (e.g. provider/default-idp-2 }}

 The best practise for these credentials is to store them in secrets within your repository and then reference them using ${{ secrets.secret_name }} so they are kept securely and hidden from the output in your action runs.

You can see the source code for the action in my repo.  The next thing I intend to look at with this is to support just staging the APIs so that it can then be manually published and any migration of subscriptions can be handled.

#whatsnew #GitHub #APIConnect

​​​

Permalink