Skip to content

Update dependencies in environment files #325

Update dependencies in environment files

Update dependencies in environment files #325

Workflow file for this run

name: fly
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
branches:
- main
workflow_dispatch:
schedule:
# Run the job every day at 6am
- cron: '0 6 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
PRODUCTION_URL: 'https://offsets-db.fly.dev/docs'
STAGING_URL: 'https://offsets-db-staging.fly.dev/docs'
jobs:
deploy:
name: deploy app
runs-on: ubuntu-latest
timeout-minutes: 20
environment:
name: ${{ github.ref == 'refs/heads/main' && 'production' || 'staging' }}
url: ${{ github.ref == 'refs/heads/main' && env.PRODUCTION_URL || env.STAGING_URL }}
if: ${{ (contains(github.event.pull_request.labels.*.name, 'api') && github.event_name == 'pull_request') || (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'}}
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- name: fly diagnostics
run: |
flyctl version
flyctl doctor
- name: Deploy to Staging
if: github.ref != 'refs/heads/main'
run: |
flyctl deploy --remote-only --config fly.staging.toml
- name: Seed Staging database
if: github.ref != 'refs/heads/main'
run: |
STAGING_URL='https://offsets-db-staging.fly.dev/files' python update_database.py staging
- name: Deploy to Production
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
run: |
flyctl deploy --remote-only --config fly.prod.toml
- name: Seed Production database
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
run: |
PRODUCTION_URL='https://offsets-db.fly.dev/files' python update_database.py production