/cloudfoundry-action

A github action to invoke commands on a cloudfoundry PAAS

Primary LanguageDockerfileMIT LicenseMIT

Cloud Foundry Action

A GitHub Docker action to authenticate to a Cloud Foundry API and use the CLI with the GitHub workflow DSL.

Supporting Cloud Foundry CLI v6.47.2 commands.

Structure

The repository is separated into two actions:

In a future release we might reduce it to cli only, but since there are some issues with passing credentials to the cli, the authentication is done by facilitating auth.

Keep your credentials encrypted

GitHub provides the feature to store credentials encrypted in the settings section of the repository you want to create a workflow. Once configured, any configured secret is available in your workflow by referencing ${{ secrets.<secretName> }}.

Example usage

name: Could Foundry Deployment
on: [push]
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - name: Build with Gradle
        run: ./gradlew clean build
      - name: Login to cloudfoundry
        uses: comsysto/cloudfoundry-action/auth@v1.0
        with:
          api: '<the-cf-api-of-your-choice>'
          user: ${{ secrets.CF_USERNAME }}
          password: ${{ secrets.CF_PASSWORD }}
      - name: Switch to cf org and space
        uses: comsysto/cloudfoundry-action/cli@v1.0
        with:
          args: target -o '<the-org-of-your-choice>' -s '<the-space-of-your-choice>'
      - name: cf push
        uses: comsysto/cloudfoundry-action/cli@v1.0
        with:
          args: push -f <path-to-the-manifest-file> -p <path-to-the-artifact-to-deploy>

Projects that uses the the cloudfoundry-action

Sources: