GitHub Action
Deploy to Clever Cloud
GitHub action to deploy your application to Clever Cloud.
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
env:
CLEVER_TOKEN: ${{ secrets.CLEVER_TOKEN }}
CLEVER_SECRET: ${{ secrets.CLEVER_SECRET }}
This 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:
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:
steps:
- uses: 47ng/actions-clever-cloud
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:
steps:
- uses: 47ng/actions-clever-cloud
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.
It looks like app_{uuidv4}
.
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:
- Install the
clever-tools
CLI locally - Login on the CLI with
clever login
and follow the Web login process - Extract the credentials:
$ cat ~/.config/clever-cloud
{"token":"[token]","secret":"[secret]"}
- In your repository settings, under Secrets, add the following secrets:
CLEVER_TOKEN
: thetoken
value in the credentialsCLEVER_SECRET
: thesecret
value in the credentials
This action follows SemVer. Please note that the API is subject to breaking changes before reaching 1.0.0.