name: CI/CD Workflow

env:
  EXPO_ASC_API_KEY_PATH: ../AuthKey_F7ZX3C8C69.p8
  EXPO_ASC_KEY_ID: F7ZX3C8C69
  EXPO_ASC_ISSUER_ID: f7d6175c-75fe-416c-b6d1-0bc9eaf87415
  EXPO_APPLE_TEAM_ID: MV9C3PHV87
  EXPO_APPLE_TEAM_TYPE: INDIVIDUAL
  EXPO_TOKEN: qt2h_4xhuhFB-ArysIkzgpsBtWOrrZ-c_So_S9ch

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  build:
    name: Install and build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20.x
          cache: yarn

      - name: Setup Expo and EAS
        uses: expo/expo-github-action@v8
        with:
          eas-version: latest
          token: ${{ secrets.EXPO_TOKEN }}

      - name: Install dependencies
        run: yarn install --immutable

      - name: Prebuild, Build and Submit
        run: yarn prebuild-build-submit-ios-cicd