{"id":13840590,"url":"https://github.com/47ng/actions-clever-cloud","last_synced_at":"2025-04-09T20:09:53.522Z","repository":{"id":37400452,"uuid":"237914340","full_name":"47ng/actions-clever-cloud","owner":"47ng","description":"GitHub Action to deploy to Clever Cloud","archived":false,"fork":false,"pushed_at":"2025-01-14T21:22:39.000Z","size":1235,"stargazers_count":40,"open_issues_count":6,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T20:09:48.722Z","etag":null,"topics":["clevercloud","github-actions"],"latest_commit_sha":null,"homepage":"https://clever-cloud.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/47ng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["franky47"],"liberapay":"francoisbest","custom":["https://paypal.me/francoisbest?locale.x=fr_FR"]}},"created_at":"2020-02-03T08:05:14.000Z","updated_at":"2025-03-30T00:46:27.000Z","dependencies_parsed_at":"2024-06-18T21:19:46.679Z","dependency_job_id":"0c1582cb-f6ec-4833-8f48-217a6b8a8361","html_url":"https://github.com/47ng/actions-clever-cloud","commit_stats":{"total_commits":253,"total_committers":8,"mean_commits":31.625,"dds":0.4031620553359684,"last_synced_commit":"889a4fcc9dcf9721a0c51afb278e1e60b95230e1"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":"actions/typescript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/47ng%2Factions-clever-cloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/47ng%2Factions-clever-cloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/47ng%2Factions-clever-cloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/47ng%2Factions-clever-cloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/47ng","download_url":"https://codeload.github.com/47ng/actions-clever-cloud/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103871,"owners_count":21048245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clevercloud","github-actions"],"created_at":"2024-08-04T17:00:50.734Z","updated_at":"2025-04-09T20:09:53.499Z","avatar_url":"https://github.com/47ng.png","language":"TypeScript","funding_links":["https://github.com/sponsors/franky47","https://liberapay.com/francoisbest","https://paypal.me/francoisbest?locale.x=fr_FR"],"categories":["TypeScript","Integration"],"sub_categories":["Docker"],"readme":"# Deploy to Clever Cloud\n\n[![Marketplace](https://img.shields.io/github/v/release/47ng/actions-clever-cloud?label=Marketplace)](https://github.com/marketplace/actions/deploy-to-clever-cloud)\n[![MIT License](https://img.shields.io/github/license/47ng/actions-clever-cloud.svg?color=blue\u0026label=License)](https://github.com/47ng/actions-clever-cloud/blob/master/LICENSE)\n[![CI/CD](https://github.com/47ng/actions-clever-cloud/workflows/CI/CD/badge.svg)](https://github.com/47ng/actions-clever-cloud/actions)\n[![GitHub Sponsors](https://img.shields.io/github/sponsors/franky47?color=%23db61a2\u0026label=Sponsors)](https://github.com/sponsors/franky47)\n\nGitHub action to deploy your application to [Clever Cloud](https://clever-cloud.com).\n\n## Prerequisite\n\n⚠️ When creating an application on Clever Cloud, you have to choose\nbetween deploying \"*from a local repository*\" (using Clever CLI, Git\nor SFTP) or \"*from a Github repository*\" (using a webhook setup\nautomatically by Clever Cloud). Only the first type of applications\ncan be deployed using this Github action.\n\nIn your project's `.clever.json`, if the `deploy_url` value starts\nwith `https://github.com/`, your application is meant to be deployed\n\"*from a Github repository*\" only.\nIf you try deploying it with this Github action, you will get the\nfollowing message in your logs: `[ERROR] HTTP Error: 401 Authorization\nRequired`.\n\nCurrently (early 2023), the only workaround is to create a new\napplication on Clever Cloud, that deploys \"*from a local repository*\",\nthen remove the Clever Cloud webhook that has been created on your\nGithub repository.\n\n## Usage\n\nIn your workflow file:\n\n```yml\nsteps:\n  # This action requires an unshallow working copy,\n  # so the following prerequisites are necessary:\n  - uses: actions/checkout@v3\n    with:\n      fetch-depth: 0\n\n  # Deploy your application\n  - uses: 47ng/actions-clever-cloud@v2.0.0\n    env:\n      CLEVER_TOKEN: ${{ secrets.CLEVER_TOKEN }}\n      CLEVER_SECRET: ${{ secrets.CLEVER_SECRET }}\n```\n\nThis minimal example assumes you have only one application for this\nrepository that was linked with `clever link`, and the `.clever.json`\nfile is versioned at the root of the repository. If that's not the case,\nread on:\n\n## Specifying the application to deploy\n\nClever Cloud uses a `.clever.json` file at the root of your repository\nto link to application IDs.\n\nIf you have committed the `.clever.json` file, you only need to specify\nthe alias of the application to deploy:\n\n```yml\n- uses: 47ng/actions-clever-cloud@v2.0.0\n  with:\n    alias: my-app-alias\n  env:\n    CLEVER_TOKEN: ${{ secrets.CLEVER_TOKEN }}\n    CLEVER_SECRET: ${{ secrets.CLEVER_SECRET }}\n```\n\nIf you don't have this `.clever.json` file or you want to explicly\ndeploy to another application, you can pass its ID:\n\n```yml\n- uses: 47ng/actions-clever-cloud@v2.0.0\n  with:\n    appID: app_facade42-cafe-babe-cafe-deadf00dbaad\n  env:\n    CLEVER_TOKEN: ${{ secrets.CLEVER_TOKEN }}\n    CLEVER_SECRET: ${{ secrets.CLEVER_SECRET }}\n```\n\nApplication IDs can be found in the [Clever Cloud console](https://console.clever-cloud.com/),\nat the top-right corner of any page for a given app, or in the Information tab.\nThey look like `app_{uuidv4}`.\n\n## Authentication\n\nYou will need to pass a token and a secret for authentication, via the\n`CLEVER_TOKEN` and `CLEVER_SECRET` environment variables.\n\nAt the time of writing, the only way to obtain those credentials is to\nre-use the ones generated for a local CLI. For that:\n\n1. Install the [`clever-tools`](https://github.com/CleverCloud/clever-tools) CLI locally\n2. Login on the CLI with `clever login` and follow the Web login process\n3. Extract the credentials:\n\n```shell\n$ cat ~/.config/clever-cloud/clever-tools.json\n{\"token\":\"[token]\",\"secret\":\"[secret]\"}\n```\n\n4. In your repository settings, [add the following secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets):\n  - `CLEVER_TOKEN`: the `token` value in the credentials\n  - `CLEVER_SECRET`: the `secret` value in the credentials\n\n## Extra Environment Variables\n\n\u003e Support: introduced in v1.2.0\n\nYou can set extra environment variables on the deployed application under the\n`setEnv` option. It follows the same syntax as .env files (newline-separated,\nkey=value).\n\n```yml\n- uses: 47ng/actions-clever-cloud@v2.0.0\n  with:\n    setEnv: | # \u003c- note the pipe here..\n      FOO=bar\n      EGG=spam\n    # ^-- ..and the indentation here\n  env:\n    CLEVER_TOKEN:  ${{ secrets.CLEVER_TOKEN }}\n    CLEVER_SECRET: ${{ secrets.CLEVER_SECRET }}\n```\n\n\u003e **Note**: you need to use a [literal block scalar](https://yaml-multiline.info/) `|` to preserve newlines in a YAML string.\n\nEnvironment variables will be set before the application is deployed,\nto let the new deployment use them.\n\n### Caveats\n\nMulti-line environment variable values (eg: SSH keys, X.509 certificates) are\ncurrently not supported (due to splitting on newline), but contributions are welcome.\n\nIf the deployment fails, the environment variables will still have been\nupdated. This could be a problem if your app restarts or scales up, as\nthe new instance would use the new variable.\n\nIn the future, we might include a way to rollback environment variables\nset by this action if deployment fails.\n\n## Deployment Timeout\n\n\u003e Support: introduced in v1.2.0\n\nBecause build minutes are precious, and also because of two ongoing issues in\nthe Clever Tools CLI (\n[#318](https://github.com/CleverCloud/clever-tools/issues/318),\n[#319](https://github.com/CleverCloud/clever-tools/issues/319)),\nyou can specify a timeout in seconds after which the workflow will move on,\nregardless of the deployment status:\n\n```yml\n- uses: 47ng/actions-clever-cloud@v2.0.0\n  with:\n    timeout: 1800 # wait at maximum 30 minutes before moving on\n  env:\n    CLEVER_TOKEN:  ${{ secrets.CLEVER_TOKEN }}\n    CLEVER_SECRET: ${{ secrets.CLEVER_SECRET }}\n```\n\n## Force deployement\n\n\u003e Support: introduced in v1.2.0\n\nClever Cloud uses a Git remote to perform deploys. By default, if the commit you want to deploy is not a fast-forward from the commit currently deployed, the deploy will be rejected. You can pass `force: true` to force the deploy anyway:\n\n```yml\n- uses: 47ng/actions-clever-cloud@v2.0.0\n  with:\n    appID: app_facade42-cafe-babe-cafe-deadf00dbaad\n    force: true\n  env:\n    CLEVER_TOKEN: ${{ secrets.CLEVER_TOKEN }}\n    CLEVER_SECRET: ${{ secrets.CLEVER_SECRET }}\n```\n\n## Logs\n\n\u003e Support: introduced in v1.3.1\n\nYou can write the deployment logs to a file for archiving:\n\n```yml\n- uses: 47ng/actions-clever-cloud@v2.0.0\n  with:\n    logFile: ./clever-cloud-deploy.log\n  env:\n    CLEVER_TOKEN: ${{ secrets.CLEVER_TOKEN }}\n    CLEVER_SECRET: ${{ secrets.CLEVER_SECRET }}\n# Optional: save the file as an artifact\n- uses: actions/upload-artifact@v2\n  name: Upload deployment logs\n  with:\n    name: clever-cloud-deploy.log\n    path: ./clever-cloud-deploy.log\n    retention-days: 30\n```\n\nIf your deployment process is susceptible to log secrets or PII, you can also\ndisable it from printing onto the console, using the `quiet` option:\n\n```yml\n- uses: 47ng/actions-clever-cloud@v2.0.0\n  with:\n    quiet: true\n  env:\n    CLEVER_TOKEN: ${{ secrets.CLEVER_TOKEN }}\n    CLEVER_SECRET: ${{ secrets.CLEVER_SECRET }}\n```\n\n### Annotations\n\nThe action will detect the [workflow commands](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-notice-message)\n`::notice`, `::error`, and `::warning` being emitted from your deployment\nlogs, and will forward them so they can be used to annotate a run.\n\n_Note: this behaviour will be disabled if the `quiet` option is used._\n\n## Versioning\n\nThis action follows [SemVer](https://semver.org/).\n\nTo specify the version of the action to use:\n- `uses: 47ng/actions-clever-cloud@v2.0.0`: latest stable version\n- `uses: 47ng/actions-clever-cloud@3e5402496b8d6492401ebb3134acfeccc25c3fce`: pinned to a specific Git SHA-1 (check out the [releases](https://github.com/47ng/actions-clever-cloud/releases))\n- `uses: docker://ghcr.io/47ng/actions-clever-cloud:latest`: latest code from master (not recommended, as it may break: hic sunt dracones.)\n\n\u003e **Note**: `uses: 47ng/actions-clever-cloud@master` will not use the latest code on the `master` branch,\n\u003e because the action manifest is pinned on the latest relase for performance reasons (it saves\n\u003e rebuilding the Docker image when consuming the action).\n\u003e\n\u003e If you wish to test unreleased features, go through Docker directly.\n\n\u003e **Note**: as of 2023-03-24, Docker images have been copied from Docker Hub\n\u003e (`47ng/actions-clever-cloud`) to GitHub Container Registry (`ghcr.io/47ng/actions-clever-cloud`),\n\u003e in response to Docker's plan to delete open source organisations on free plans.\n\u003e\n\u003e Although they backtracked on this decision, the images are now dual-published\n\u003e on both platforms, and default to being downloaded from GitHub Container Registry\n\u003e for (seemingly) better performance.\n\n## Why ?\n\nClever Cloud lets you connect your GitHub repository so that any push is\ndeployed. This is great for staging environments, but in some cases you\nmay want to deploy to production only on specific events, like a release\nbeing published, or after a CI run.\n\n## License\n\n[MIT](https://github.com/47ng/actions-clever-cloud/blob/master/LICENSE) - Made with ❤️ by [François Best](https://francoisbest.com)\n\nUsing this action at work ? [Sponsor me](https://github.com/sponsors/franky47) to help with support and maintenance.\n\n## Deploying a Specific Directory\n\n\u003e ⚠️ Important note about the difference between `working-directory` and `deployPath`:\n\u003e\n\u003e - `working-directory` (GitHub Actions option) : Only changes the directory where the action runs. All files remain available, only the execution context changes.\n\u003e \n\u003e - `deployPath` (this action's option) : Specifies exactly which files will be sent to Clever Cloud. Allows deploying only a subset of files, like a `dist` or `build` folder.\n\n### Example\n\n```yml\n# This will NOT deploy only the build folder:\n- uses: 47ng/actions-clever-cloud@v2.0.0\n  with:\n    working-directory: ./build    # ❌ Only changes where the action runs\n\n# This will deploy only the build folder:\n- uses: 47ng/actions-clever-cloud@v2.0.0\n  with:\n    deployPath: ./build          # ✅ Only sends these files to Clever Cloud\n```\n\nThis option is particularly useful for:\n- Monorepos where you want to deploy a single package\n- Projects where you only want to deploy built/compiled files\n- Filtering which files are sent to Clever Cloud\n\nNote: The path must be relative to the repository root and must exist.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F47ng%2Factions-clever-cloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F47ng%2Factions-clever-cloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F47ng%2Factions-clever-cloud/lists"}