name: Deploy

on:
  workflow_dispatch:

permissions:
  contents: read

env:
  FASTLANE: ${{ secrets.FASTLANE }}

jobs:
  bundle:
    uses: ./.github/workflows/bundle.yml
    secrets: inherit
  deploy:
    runs-on: ubuntu-latest
    needs: [ bundle ]
    steps:
      - uses: actions/checkout@v4
      - name: Fastlane key
        run: |
          echo "$FASTLANE" > ./fastlane.json
      - uses: ruby/setup-ruby@v1
        with:
          bundler-cache: true
      - uses: actions/download-artifact@v4
        with:
          name: release
          path: .
      - name: Deploy
        run: bundle exec fastlane deploy
