DEV Community

Cover image for [GitHub Actions] IBM Cloud Foundry Deploy
Subham Sahu
Subham Sahu

Posted on • Updated on

[GitHub Actions] IBM Cloud Foundry Deploy

Hey there, this blog post is my submission for the actions hackathon. I will be explaining the problem at first and then will reveal the GitHub action which solves the problem. Happy Reading!

Problem

I use IBM cloud foundry to host my cloud-native applications. Every time I changed the code, I had to re-deploy it again to cloud foundry via the CLI. I wanted to automate this process. My code is hosted on GitHub, and I was surprised to see that there were no GitHub actions available to deploy to Cloud foundry.

My Workflow

To solve this problem I built IBM Cloud Foundry Deploy which is a GitHub action. It allows you to deploy 🚀 the application to IBM cloud foundry seamlessly. We can deploy runtimes of Java, Node.js, PHP, Python, Ruby, ASP.NET, Tomcat, Swift and Go to Cloud Foundry.

What is Cloud Foundry?

Cloud Foundry is the industry-standard open source cloud application platform for developing and deploying enterprise cloud applications. Get started today!

For more information on IBM cloud foundry, please visit here.

Features Overview

  • The action supports both authentications using API key and using Username and Password.
  • Now you can seamlessly deploy your application to the IBM cloud foundry on every push.
  • The action's logic is independent of the trigger event. More precisely, most of the events that trigger the workflow like cron, push etc all are supported.

Submission Category:

DIY Deployments
Maintainer Must-Haves

Yaml File or Link to Code

Here is an example YAML snippet for the workflow to be run

name: Deploy to IBM Cloud Foundry
on:
  push:
    branches: [master]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Deploy MyApp
      uses: subhamx/ibm-cloud-foundry-deploy@master
      with:
        # For Users who have opted for auth using Email & Password
        EMAIL: ${{ secrets.USER_EMAIL }}
        PASSWORD: ${{ secrets.USER_PASSWORD }}
        # For Users who have opted for Authentication using API KEY
        API_KEY: ${{ secrets.IBM_API_KEY }}
        # Cloud Foundry API Endpoint
        CF_API_ENDPOINT: ${{ secrets.CF_API_ENDPOINT }}
        # Path to manifest.yml
        MANIFEST_FILE_PATH: './src/manifest.yml'
        # Cloud Foundry ORG Name
        ORG: ${{ secrets.ORG }}
        # Cloud Foundry Space Name for the specified ORG
        SPACE: ${{ secrets.SPACE }}
Enter fullscreen mode Exit fullscreen mode

GitHub Repo

GitHub logo subhamX / ibm-cloud-foundry-deploy

🚀 A Github Action which allows developers to deploy the application to IBM cloud foundry seamlessly.

IBM Cloud Foundry Deploy

A github action which allows developers to automate the deploy 🚀 process to IBM cloud foundry.

What is Cloud Foundry?

Cloud Foundry is the industry-standard open source cloud application platform for developing and deploying enterprise cloud applications. Get started today!

For more information on IBM cloud foundry, please visit here.

Pre-requisites

  • You need to have an IBM Cloud account and a cloud foundry instance.
  • You can create a free IBM Cloud account here and create a new cloud foundry instance here.

Checklist

  • This action allows you to deploy applications built on runtimes of Java, Node.js, PHP, Python, Ruby, ASP.NET, Tomcat, Swift and Go to Cloud Foundry You need to define your deployment details like number of application instances to create, the amount of memory and disk quota to allocate, and other environment variables in the manifest.yml…




Workflow in action

Head over to this repo which hosts a simple NodeJS application, and uses this action to deploy the application to IBM Cloud on every push to master branch.
Alt Text

Thank You!

Top comments (2)

Collapse
 
snakepy profile image
Fabio

Hey, I see that you also like to participate in hackathons! I am always looking for skilled and motivated people for that. Maybe we can connect on discord :D

Collapse
 
subhamx profile image
Subham Sahu

Sure. let's connect; subhm#5158