diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index fc6c25d..b7ad663 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,7 +1,12 @@ name: Fly Deploy -on: [push] +on: + push: + branches: + - main env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} + PRODUCTION_URL: 'https://html-reprs.fly.dev/docs' + STAGING_URL: 'https://html-reprs.fly.dev/docs' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -11,6 +16,9 @@ jobs: deploy: name: Deploy app runs-on: ubuntu-latest + environment: + name: ${{ github.ref == 'refs/heads/main' && 'production' || 'staging' }} + url: ${{ github.ref == 'refs/heads/main' && env.PRODUCTION_URL || env.STAGING_URL }} steps: - uses: actions/checkout@v4 - uses: superfly/flyctl-actions/setup-flyctl@master