A github action which allows developers to automate the deploy ๐ process to IBM 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.
- 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.
- 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
file. For more information on App Manifests head over to these links. one and two. - We recommend using
.cfignore
and adding.git/
, and other files, directories which you would like to ignore during the deployment.
We need access to your account to be able to deploy the application. Currently, we support two types of authentication. You can choose any one of the following based on your preference.
- Authentication using API KEY (Recommended)
- Authentication using Email & Password
To generate a new API KEY, head over to this link and click on Create an IBM Cloud API key. Give the API KEY a name like gh-cf-deploy
and click on Create
button.
Now copy the API KEY and make sure you store it safely. Please note that you won't be able to see this API key again, so you can't retrieve it later.
Voila! You have successfully generated the API KEY, and now you need to add it into GitHub secrets. ๐๐
-
Navigate to your repo.
-
Click on Settings and navigate to the "Secrets" tab.
-
Now, add the
CF_API_ENDPOINT
in Name, and the API endpoint in theValue
. Here is a small table which maps the Public CF Endpoint to the region.Region CF API Endpoint public CF us-south https://api.us-south.cf.cloud.ibm.com public CF eu-de https://api.eu-de.cf.cloud.ibm.com public CF eu-gb https://api.eu-gb.cf.cloud.ibm.com public CF au-syd https://api.au-syd.cf.cloud.ibm.com public CF us-east https://api.us-east.cf.cloud.ibm.com -
Similarly, add
ORG
andSPACE
to GitHub secrets. -
If you wish to go with
Authentication using API KEY
, then putIBM_API_KEY
in Name, and the API_KEY generated in the previous step in theValue
Textbox. -
If you wish to go with
Authentication using Email & Password
, then putUSER_EMAIL
in Name and your IBM Email in theValue
textbox. -
Similarly, add
USER_PASSWORD
in Name and your IBM Password in theValue
textbox.
Please note that you need to either add the IBM_API_KEY or USER_EMAIL and USER_PASSWORD. If you add both of them, then either of these two will be used for authentication.
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 Authentication 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 }}
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.
Note: We are suppressing all major logs as IBM CLI displays your IBM cloud email, org name, etc. during the deploy. In this process, some information like final deploy URL etc. is also getting ignored. IBM Cloud CLI generates these logs, and there isn't an option to filter them. We are working on adding more detailed information to the action logs after filtering out sensitive ones. This action will output the final Deploy URL, and more detailed build information in the next version, very soon! Meanwhile, you can access the deploy logs and additional information in the cloud foundry dashboard.
This project welcomes contributions and suggestions. Feel free to report bugs and suggest features. It will help us improve this project. โกโก