diff --git a/README.md b/README.md index 5effd26..1ee234e 100644 --- a/README.md +++ b/README.md @@ -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] @@ -14,7 +16,6 @@ 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 }} @@ -22,6 +23,25 @@ jobs: 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 diff --git a/entrypoint.sh b/entrypoint.sh index 3c3cf7a..1492860 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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="$?"