Fly Deploy #191
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Fly Deploy | |
# Wait until the CI tests complete | |
on: | |
workflow_run: | |
workflows: ["Django CI"] | |
branches: [main] | |
types: | |
- completed | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
FMP_API_KEY: ${{ secrets.FMP_API_KEY }} | |
jobs: | |
deploy: | |
name: Deploy App | |
runs-on: ubuntu-latest | |
# Deploy to Fly.io if the CI workflow was successful | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup flyctl | |
uses: superfly/flyctl-actions/setup-flyctl@master | |
- name: Set Environment | |
run: echo "SECRET_KEY=$(openssl rand -base64 32)" >> $GITHUB_ENV | |
- name: Deploy to Fly.io | |
run: flyctl deploy --remote-only | |
timeout-minutes: 10 # default: 6 hours |