Skip to content

Add health check to fly.toml (#24) #9

Add health check to fly.toml (#24)

Add health check to fly.toml (#24) #9

Workflow file for this run

name: Deploy to Fly
on:
workflow_dispatch: {}
push:
branches:
- main
paths:
- Dockerfile
- fly.toml
- config/**
- scripts/**
jobs:
check-fly-secret:
runs-on: ubuntu-latest
outputs:
fly-secret-exists: ${{ steps.fly-secret-check.outputs.defined }}
steps:
- name: Check for Fly secrets availability
id: fly-secret-check
# perform secret check & put boolean result as an output
shell: bash
run: |
if [ "${{ secrets.FLY_API_TOKEN }}" != '' ] && [ "${{ secrets.FLY_APP }}" != '' ]; then
echo "defined=true" >> $GITHUB_OUTPUT;
else
echo "defined=false" >> $GITHUB_OUTPUT;
fi
deploy:
name: Deploy app
runs-on: ubuntu-latest
needs: [check-fly-secret]
if: needs.check-fly-secret.outputs.fly-secret-exists == 'true'
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: superfly/flyctl-actions/setup-flyctl@master
with:
version: 0.1.54
- name: Install Task
uses: arduino/setup-task@v1
with:
# renovate: datasource=github-releases depName=go-task/task
version: 3.27.1
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy app
run: flyctl deploy --remote-only -a $FLY_APP
env:
FLY_APP: ${{ secrets.FLY_APP }}
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}