Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
upload-cloud

GitHub Action

Deploy to Clever Cloud

v0.6.0

Deploy to Clever Cloud

upload-cloud

Deploy to Clever Cloud

Deploy your application to Clever Cloud

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Deploy to Clever Cloud

uses: 47ng/actions-clever-cloud@v0.6.0

Learn more about this action in 47ng/actions-clever-cloud

Choose a version

Deploy to Clever Cloud

Marketplace MIT License CI/CD Dependabot Status Average issue resolution time Number of open issues

GitHub action to deploy your application to Clever Cloud.

Usage

In your workflow file:

steps:
  # This action requires an unshallow working copy,
  # so the following prerequisites are necessary:
  - uses: actions/checkout@v2
  - run: git fetch --prune --unshallow

  # Deploy your application
  - uses: 47ng/actions-clever-cloud@v0.5.0
    env:
      CLEVER_TOKEN: ${{ secrets.CLEVER_TOKEN }}
      CLEVER_SECRET: ${{ secrets.CLEVER_SECRET }}

This minimal example assumes you have only one application for this repository that was linked with clever link, and the .clever.json file is versioned at the root of the repository. If that's not the case, read on:

Specifying the application to deploy

Clever Cloud uses a .clever.json file at the root of your repository to link to application IDs.

If you have committed the .clever.json file, you only need to specify the alias of the application to deploy:

- uses: 47ng/actions-clever-cloud@v0.5.0
  with:
    alias: my-app-alias
  env:
    CLEVER_TOKEN: ${{ secrets.CLEVER_TOKEN }}
    CLEVER_SECRET: ${{ secrets.CLEVER_SECRET }}

If you don't have this .clever.json file or you want to explicly deploy to another application, you can pass its ID:

- uses: 47ng/actions-clever-cloud@v0.5.0
  with:
    appID: app_facade42-cafe-babe-cafe-deadf00dbaad
  env:
    CLEVER_TOKEN: ${{ secrets.CLEVER_TOKEN }}
    CLEVER_SECRET: ${{ secrets.CLEVER_SECRET }}

Application IDs can be found in the Clever Cloud console, at the top-right corner of any page for a given app, or in the Information tab. They look like app_{uuidv4}.

Authentication

You will need to pass a token and a secret for authentication, via the CLEVER_TOKEN and CLEVER_SECRET environment variables.

At the time of writing, the only way to obtain those credentials is to re-use the ones generated for a local CLI. For that:

  1. Install the clever-tools CLI locally
  2. Login on the CLI with clever login and follow the Web login process
  3. Extract the credentials:
$ cat ~/.config/clever-cloud
{"token":"[token]","secret":"[secret]"}
  1. In your repository settings, add the following secrets:
  • CLEVER_TOKEN: the token value in the credentials
  • CLEVER_SECRET: the secret value in the credentials

Versioning

This action follows SemVer. Please note that the API is subject to breaking changes before reaching 1.0.0.

To specify the version of the action to use:

  • uses: 47ng/actions-clever-cloud@v0.5.0: latest stable version
  • uses: 47ng/actions-clever-cloud@master: latest code from master
  • uses: 47ng/actions-clever-cloud@v1.2.3: a specific version

Why ?

Clever Cloud lets you connect your GitHub repository so that any push is deployed. This is great for staging environments, but in some cases you may want to deploy to production only on specific events, like a release being published, or after a CI run.

Roadmap to 1.0.0

  • Test all deployment cases:
    • .clever.json, single app, no arguments
    • .clever.json, multiple apps, alias
    • .clever.json, explicit appID
    • no .clever.json, appID
  • Testing against clevercloud/clever-tools#318 (process hanging) => might be hard to reproduce
  • Provide early exit option => clevercloud/clever-tools#319