Skip to content

Commit adbb124

Browse files
authored
Merge pull request #14 from kulor/master
Only set strategy if it's a deploy command
2 parents d81c6d5 + 65f85de commit adbb124

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ This action wraps the flyctl CLI tool to allow deploying and managing fly apps.
44

55
## Usage
66

7+
### Deploy
8+
79
```yaml
810
name: Deploy to Fly
911
on: [push]
@@ -14,14 +16,32 @@ jobs:
1416
steps:
1517
# This step checks out a copy of your repository.
1618
- uses: actions/checkout@v2
17-
# This step runs `flyctl deploy`.
1819
- uses: superfly/flyctl-actions@master
1920
env:
2021
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
2122
with:
2223
args: "deploy"
2324
```
2425
26+
27+
### Run one off scripts
28+
29+
```yaml
30+
name: Run on Fly
31+
on: [push]
32+
jobs:
33+
deploy:
34+
name: Run script
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v2
38+
- uses: superfly/flyctl-actions@master
39+
env:
40+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
41+
with:
42+
args: "ssh console --command 'sh ./myscript.sh'"
43+
```
44+
2545
See the [flyctl](https://github.com/superfly/flyctl) GitHub project for more information on using `flyctl`.
2646

2747
## Secrets

entrypoint.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ for i in "$@" ; do
1717
fi
1818
done
1919

20+
if [[ $1 != "deploy" ]] ; then
21+
# Strategy only relevant to deployments so strip if not a deploy
22+
STRATEGY=""
23+
fi
24+
2025
sh -c "flyctl $* $STRATEGY"
2126

2227
ACTUAL_EXIT="$?"

0 commit comments

Comments
 (0)