Skip to content

Commit

Permalink
Merge pull request #14 from kulor/master
Browse files Browse the repository at this point in the history
Only set strategy if it's a deploy command
  • Loading branch information
jsierles authored Feb 4, 2022
2 parents d81c6d5 + 65f85de commit adbb124
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This action wraps the flyctl CLI tool to allow deploying and managing fly apps.

## Usage

### Deploy

```yaml
name: Deploy to Fly
on: [push]
Expand All @@ -14,14 +16,32 @@ jobs:
steps:
# This step checks out a copy of your repository.
- uses: actions/checkout@v2
# This step runs `flyctl deploy`.
- uses: superfly/flyctl-actions@master
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
with:
args: "deploy"
```
### Run one off scripts
```yaml
name: Run on Fly
on: [push]
jobs:
deploy:
name: Run script
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: superfly/flyctl-actions@master
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
with:
args: "ssh console --command 'sh ./myscript.sh'"
```
See the [flyctl](https://github.com/superfly/flyctl) GitHub project for more information on using `flyctl`.

## Secrets
Expand Down
5 changes: 5 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ for i in "$@" ; do
fi
done

if [[ $1 != "deploy" ]] ; then
# Strategy only relevant to deployments so strip if not a deploy
STRATEGY=""
fi

sh -c "flyctl $* $STRATEGY"

ACTUAL_EXIT="$?"
Expand Down

0 comments on commit adbb124

Please sign in to comment.