-
Notifications
You must be signed in to change notification settings - Fork 10
/
action.yml
50 lines (46 loc) · 1.62 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Deploy to IBM Cloud Foundry
description: Deploy an application to Cloud Foundry on IBM Cloud
branding:
icon: upload-cloud
color: blue
inputs:
IBM_CLOUD_API_KEY:
description: IBM Cloud API key
required: true
IBM_CLOUD_CF_API:
description: IBM Cloud Foundry API endpoint
required: true
IBM_CLOUD_CF_ORG:
description: IBM Cloud Foundry organization name
required: true
IBM_CLOUD_CF_SPACE:
description: IBM Cloud Foundry space name
required: true
APP_MANIFEST_FILE:
description: App Manifest file
required: false
default: manifest.yml
APP_VARS_FILE:
description: App variables file
required: false
RESOURCE_GROUP:
description: IBM Cloud Foundry resource group
required: false
runs:
using: "composite"
steps:
- name: Install IBM Cloud CLI
run: curl -fsSL https://clis.cloud.ibm.com/install/linux | sh
shell: bash
- name: Install Cloud Foundry CLI
run: ibmcloud cf install
shell: bash
- name: Authenticate with IBM Cloud CLI
run: ibmcloud login --apikey "${{ inputs.IBM_CLOUD_API_KEY }}" --no-region $( [[ ! -z "${{ inputs.RESOURCE_GROUP }}" ]] && echo "-g ${{ inputs.RESOURCE_GROUP }}")
shell: bash
- name: Target a Cloud Foundry org and space
run: ibmcloud target --cf-api "${{ inputs.IBM_CLOUD_CF_API }}" -o "${{ inputs.IBM_CLOUD_CF_ORG }}" -s "${{ inputs.IBM_CLOUD_CF_SPACE }}"
shell: bash
- name: Deploy to Cloud Foundry
run: ibmcloud cf push -f "${{ inputs.APP_MANIFEST_FILE }}" $( [[ ! -z "${{ inputs.APP_VARS_FILE }}" ]] && echo "--vars-file ${{ inputs.APP_VARS_FILE }}")
shell: bash