-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(setup-scalingo): add automation for releases (#2)
- Loading branch information
1 parent
0677976
commit 4696afa
Showing
5 changed files
with
128 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
name: release-please-setup-scalingo | ||
|
||
env: | ||
ACTION_NAME: release-please-action | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: google-github-actions/release-please-action@v3 | ||
with: | ||
release-type: simple | ||
package-name: ${{ env.ACTION_NAME }} | ||
command: github-release | ||
- uses: actions/checkout@v2 | ||
if: ${{ steps.release.outputs.release_created }} | ||
- name: tag major and minor versions | ||
if: ${{ steps.release.outputs.release_created }} | ||
run: | | ||
git config user.name github-actions[bot] | ||
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | ||
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/scalingo-community/setup-scalingo.git" | ||
git tag -d v${{ steps.release.outputs.major }} || true | ||
git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true | ||
git push origin :v${{ steps.release.outputs.major }} || true | ||
git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true | ||
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}" | ||
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}" | ||
git push origin v${{ steps.release.outputs.major }} | ||
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,86 @@ | ||
## Github Actions for Scalingo | ||
# scalingo-community/setup-scalingo | ||
|
||
## Community-powered | ||
These actions are a community initiative of users and are in no way related to or supported by Scalingo. | ||
Your feedbacks and contributions are welcome to correct or improve them. | ||
The `scalingo-community/setup-scalingo` action is a composite action that sets up Scalingo CLI in your GitHub Actions workflow by: | ||
|
||
## Contributions are welcome | ||
- Downloading the latest or a specific version of Scalingo CLI and adding it to the PATH. | ||
- Configuring the Scalingo CLI configuration file with your region, app name and Scalingo API token. | ||
|
||
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 | ||
|
||
## Usage | ||
|
||
This action can be run on `ubuntu-latest` and `macos-latest` GitHub Actions runners. Note that the `region` input is always required. | ||
|
||
The default configuration installs the latest version of Scalingo CLI: | ||
``` | ||
steps: | ||
- uses: scalingo-community/setup-scalingo@v1 | ||
with: | ||
region: 'osc-fr1' | ||
``` | ||
|
||
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)): | ||
``` | ||
steps: | ||
- uses: scalingo-community/setup-scalingo@v1 | ||
with: | ||
region: 'osc-fr1' | ||
api_token: '${{ secrets.scalingo_api_token }} | ||
app_name: 'my_app' | ||
- run: scalingo restart # will restart all the processes of the app "my_app" in region "osc-fr1" | ||
``` | ||
|
||
|
||
|
||
## Inputs | ||
The action requires the following inputs: | ||
|
||
- `region` - The region of your app. | ||
|
||
The action also accepts the following optional inputs: | ||
|
||
- `api_token` - The Scalingo API token to use. If not provided, the subsequent steps will try to use the `SCALINGO_API_TOKEN` environment variable. | ||
- `version` - The version of Scalingo CLI to install. If not provided, the action will install the latest version. | ||
- `app_name` - The name of the app to use. If not provided, the subsequent steps will try to use the `SCALINGO_APP` environment variable. | ||
- `git_remote` - Choose the name of Git remote to allow git operations (requires the `region` and `app_name` inputs). The default value is `scalingo`. | ||
|
||
|
||
For testing or debugging purpose, the following inputs can also be used: | ||
|
||
- `scalingo_api_url` - The Scalingo API URL to use. If not provided, the action will use the default API URL for the given region. | ||
- `scalingo_auth_url` - The Scalingo Auth URL to use. If not provided, the action will use the default Auth URL for the given region. | ||
- `unsecure_ssl` - Disable SSL verification with APIs. | ||
- `scalingo_db_url` - The Scalingo DB URL to use. If not provided, the action will use the default DB URL for the given region. | ||
- `scalingo_ssh_host` - The Scalingo SSH Host to use. If not provided, the action will use the default SSH Host for the given region. | ||
|
||
## Features | ||
|
||
### Git remote auto-configuration | ||
|
||
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. | ||
|
||
``` | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- Configure Scalingo CLI | ||
uses: scalingo-community/setup-scalingo@v1 | ||
with: | ||
region: 'osc-fr1' | ||
app_name: 'my_app' | ||
- name: Deploy to Scalingo with Git | ||
run: git push scalingo main | ||
``` | ||
|
||
### Custom version of Scalingo CLI | ||
|
||
You can install a specific version of Scalingo CLI: | ||
``` | ||
steps: | ||
- uses: scalingo-community/setup-scalingo@v1 | ||
with: | ||
region: 'osc-fr1' | ||
version: 1.28.2 | ||
``` | ||
|
||
_especially for the following topics_: | ||
- 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` | ||
- full-compatibility with Windows runners | ||
- action to run commands in one-off containers | ||
- action to create database backup | ||
- action to create review app (with optional database copy !) |
File renamed without changes.
This file was deleted.
Oops, something went wrong.