|
1 |
| -## Github Actions for Scalingo |
| 1 | +# scalingo-community/setup-scalingo |
2 | 2 |
|
3 |
| -## Community-powered |
4 |
| -These actions are a community initiative of users and are in no way related to or supported by Scalingo. |
5 |
| -Your feedbacks and contributions are welcome to correct or improve them. |
| 3 | +The `scalingo-community/setup-scalingo` action is a composite action that sets up Scalingo CLI in your GitHub Actions workflow by: |
6 | 4 |
|
7 |
| -## Contributions are welcome |
| 5 | +- Downloading the latest or a specific version of Scalingo CLI and adding it to the PATH. |
| 6 | +- Configuring the Scalingo CLI configuration file with your region, app name and Scalingo API token. |
| 7 | + |
| 8 | +After you've used the action, subsequent steps in the same job can run arbitrary Scalingo commands using the GitHub Actions `run:` syntax. This allows most Scalingo commands to work exactly like they do on your local command line |
| 9 | + |
| 10 | +## Usage |
| 11 | + |
| 12 | +This action can be run on `ubuntu-latest` and `macos-latest` GitHub Actions runners. Note that the `region` input is always required. |
| 13 | + |
| 14 | +The default configuration installs the latest version of Scalingo CLI: |
| 15 | +``` |
| 16 | +steps: |
| 17 | +- uses: scalingo-community/setup-scalingo@v1 |
| 18 | + with: |
| 19 | + region: 'osc-fr1' |
| 20 | +``` |
| 21 | + |
| 22 | +Subsequent steps can launch command with the configured and authenticated CLI (you can create API Token [in the Scalingo dashboard](https://dashboard.scalingo.com/account/tokens)): |
| 23 | +``` |
| 24 | +steps: |
| 25 | +- uses: scalingo-community/setup-scalingo@v1 |
| 26 | + with: |
| 27 | + region: 'osc-fr1' |
| 28 | + api_token: '${{ secrets.scalingo_api_token }} |
| 29 | + app_name: 'my_app' |
| 30 | +
|
| 31 | +- run: scalingo restart # will restart all the processes of the app "my_app" in region "osc-fr1" |
| 32 | +``` |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | +## Inputs |
| 37 | +The action requires the following inputs: |
| 38 | + |
| 39 | +- `region` - The region of your app. |
| 40 | + |
| 41 | +The action also accepts the following optional inputs: |
| 42 | + |
| 43 | +- `api_token` - The Scalingo API token to use. If not provided, the subsequent steps will try to use the `SCALINGO_API_TOKEN` environment variable. |
| 44 | +- `version` - The version of Scalingo CLI to install. If not provided, the action will install the latest version. |
| 45 | +- `app_name` - The name of the app to use. If not provided, the subsequent steps will try to use the `SCALINGO_APP` environment variable. |
| 46 | +- `git_remote` - Choose the name of Git remote to allow git operations (requires the `region` and `app_name` inputs). The default value is `scalingo`. |
| 47 | + |
| 48 | + |
| 49 | +For testing or debugging purpose, the following inputs can also be used: |
| 50 | + |
| 51 | +- `scalingo_api_url` - The Scalingo API URL to use. If not provided, the action will use the default API URL for the given region. |
| 52 | +- `scalingo_auth_url` - The Scalingo Auth URL to use. If not provided, the action will use the default Auth URL for the given region. |
| 53 | +- `unsecure_ssl` - Disable SSL verification with APIs. |
| 54 | +- `scalingo_db_url` - The Scalingo DB URL to use. If not provided, the action will use the default DB URL for the given region. |
| 55 | +- `scalingo_ssh_host` - The Scalingo SSH Host to use. If not provided, the action will use the default SSH Host for the given region. |
| 56 | + |
| 57 | +## Features |
| 58 | + |
| 59 | +### Git remote auto-configuration |
| 60 | + |
| 61 | +If the code you provide the `region` and `app_name` inputs, the action will automatically configure a Git remote named `scalingo` to allow git operations on your app. This is useful if you want to run `git push scalingo master` in your workflow. |
| 62 | + |
| 63 | +``` |
| 64 | +steps: |
| 65 | +- name: Checkout code |
| 66 | + uses: actions/checkout@v3 |
| 67 | +- Configure Scalingo CLI |
| 68 | + uses: scalingo-community/setup-scalingo@v1 |
| 69 | + with: |
| 70 | + region: 'osc-fr1' |
| 71 | + app_name: 'my_app' |
| 72 | +- name: Deploy to Scalingo with Git |
| 73 | + run: git push scalingo main |
| 74 | +``` |
| 75 | + |
| 76 | +### Custom version of Scalingo CLI |
| 77 | + |
| 78 | +You can install a specific version of Scalingo CLI: |
| 79 | +``` |
| 80 | +steps: |
| 81 | +- uses: scalingo-community/setup-scalingo@v1 |
| 82 | + with: |
| 83 | + region: 'osc-fr1' |
| 84 | + version: 1.28.2 |
| 85 | +``` |
8 | 86 |
|
9 |
| -_especially for the following topics_: |
10 |
| -- rewriting the full setup-scalingo action in TS (instead of a composite "shell" Action, inspired from [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform)), this will enable automatic caching thanks to `@actions/tool-cache` |
11 |
| -- full-compatibility with Windows runners |
12 |
| -- action to run commands in one-off containers |
13 |
| -- action to create database backup |
14 |
| -- action to create review app (with optional database copy !) |
|
0 commit comments