name: Fly Deploy
on:
  push:
    branches:
      - main
          
env:
  FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
  ADYEN_API_KEY: ${{ secrets.ADYEN_API_KEY }}
  ADYEN_CLIENT_KEY: ${{ secrets.ADYEN_CLIENT_KEY }}
  ADYEN_HMAC_KEY: ${{ secrets.ADYEN_HMAC_KEY }}
  ADYEN_MERCHANT_ACCOUNT: ${{ secrets.ADYEN_MERCHANT_ACCOUNT }}
jobs:
  deploy:
      environment: zeOne
      name: Deploy app
      runs-on: ubuntu-latest
      steps:
        - uses: actions/checkout@v3
        - uses: superfly/flyctl-actions/setup-flyctl@master
        - run: flyctl secrets set ADYEN_API_KEY="$ADYEN_API_KEY"
        - run: flyctl secrets set ADYEN_CLIENT_KEY="$ADYEN_CLIENT_KEY"
        - run: flyctl secrets set ADYEN_HMAC_KEY="$ADYEN_HMAC_KEY"
        - run: flyctl secrets set ADYEN_MERCHANT_ACCOUNT="$ADYEN_MERCHANT_ACCOUNT"
        - run: flyctl deploy --remote-only