Skip to content

Commit 96d1b5e

Browse files
committed
fix
1 parent 35513af commit 96d1b5e

File tree

4 files changed

+107
-101
lines changed

4 files changed

+107
-101
lines changed

.github/workflows/release-please.yml

+23-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,33 @@ permissions:
77
contents: write
88
pull-requests: write
99

10-
name: release-please
10+
name: release-please-setup-scalingo
11+
12+
env:
13+
ACTION_NAME: release-please-action
1114

1215
jobs:
1316
release-please:
1417
runs-on: ubuntu-latest
1518
steps:
1619
- uses: google-github-actions/release-please-action@v3
1720
with:
18-
release-type: node
19-
package-name: release-please-action
21+
release-type: simple
22+
package-name: ${{ env.ACTION_NAME }}
23+
command: github-release
24+
- uses: actions/checkout@v2
25+
if: ${{ steps.release.outputs.release_created }}
26+
- name: tag major and minor versions
27+
if: ${{ steps.release.outputs.release_created }}
28+
run: |
29+
git config user.name github-actions[bot]
30+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
31+
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/scalingo-community/setup-scalingo.git"
32+
git tag -d v${{ steps.release.outputs.major }} || true
33+
git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
34+
git push origin :v${{ steps.release.outputs.major }} || true
35+
git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
36+
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}"
37+
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}"
38+
git push origin v${{ steps.release.outputs.major }}
39+
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}

README.md

+83-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,86 @@
1-
## Github Actions for Scalingo
1+
# scalingo-community/setup-scalingo
22

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:
64

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+
```
886

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 !)

setup-scalingo/action.yaml renamed to action.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ runs:
130130
- name: Configure Scalingo CLI
131131
shell: bash
132132
run: |
133-
echo "-----> Configuration"
133+
echo "------> Configuring Scalingo CLI"
134134
135135
echo "LOG_FILE=/dev/stdout" >> $GITHUB_ENV
136136

setup-scalingo/README.md

-86
This file was deleted.

0 commit comments

Comments
 (0)