Created
July 2, 2025 14:30
-
-
Save kharioki/9f5f7650007a2acac2446e7d4a7826fe to your computer and use it in GitHub Desktop.
Eas config for prod and staging deployment and submissions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: EAS Build and Submit | |
| on: | |
| push: | |
| branches: | |
| - 'main' # Production deployments | |
| - 'staging' # Staging deployments | |
| jobs: | |
| determine_environment: | |
| name: Determine Environment | |
| runs-on: ubuntu-latest | |
| outputs: | |
| profile: ${{ steps.set-profile.outputs.profile }} | |
| steps: | |
| - name: Check branch | |
| id: set-profile | |
| run: | | |
| if [ "$GITHUB_REF_NAME" = "main" ]; then | |
| echo "profile=production" >> $GITHUB_OUTPUT | |
| else | |
| echo "profile=staging" >> $GITHUB_OUTPUT | |
| fi | |
| build_android: | |
| name: Build Android | |
| needs: determine_environment | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: expo/expo-github-action@v7 | |
| with: | |
| eas-version: latest | |
| token: ${{ secrets.EXPO_TOKEN }} | |
| - name: Build Android | |
| run: eas build --platform android --profile ${{ needs.determine_environment.outputs.profile }} | |
| env: | |
| EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }} | |
| - name: Set build ID output | |
| id: set-android-build-id | |
| run: | | |
| build_id=$(eas build:list --platform android --profile ${{ needs.determine_environment.outputs.profile }} --json | jq -r '.[0].id') | |
| echo "build_id=$build_id" >> $GITHUB_OUTPUT | |
| build_ios: | |
| name: Build iOS | |
| needs: determine_environment | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: expo/expo-github-action@v7 | |
| with: | |
| eas-version: latest | |
| token: ${{ secrets.EXPO_TOKEN }} | |
| - name: Build iOS | |
| run: eas build --platform ios --profile ${{ needs.determine_environment.outputs.profile }} | |
| env: | |
| EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }} | |
| - name: Set build ID output | |
| id: set-ios-build-id | |
| run: | | |
| build_id=$(eas build:list --platform ios --profile ${{ needs.determine_environment.outputs.profile }} --json | jq -r '.[0].id') | |
| echo "build_id=$build_id" >> $GITHUB_OUTPUT | |
| submit_android: | |
| name: Submit Android | |
| needs: build_android | |
| if: ${{ always() }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: expo/expo-github-action@v7 | |
| with: | |
| eas-version: latest | |
| token: ${{ secrets.EXPO_TOKEN }} | |
| - name: Submit Android to Play Store | |
| run: eas submit --platform android --id ${{ needs.build_android.outputs.build_id }} --profile ${{ needs.determine_environment.outputs.profile }} | |
| env: | |
| EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }} | |
| submit_ios: | |
| name: Submit iOS | |
| needs: build_ios | |
| if: ${{ always() }} | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: expo/expo-github-action@v7 | |
| with: | |
| eas-version: latest | |
| token: ${{ secrets.EXPO_TOKEN }} | |
| - name: Submit iOS to App Store | |
| run: eas submit --platform ios --id ${{ needs.build_ios.outputs.build_id }} --profile ${{ needs.determine_environment.outputs.profile }} | |
| env: | |
| EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }} | |
| notify: | |
| name: Notify Team | |
| needs: [submit_android, submit_ios] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Send Slack notification | |
| uses: slackapi/slack-github-action@v1 | |
| with: | |
| channel-id: 'deployments' | |
| slack-message: | | |
| ${{ github.ref_name == 'main' && '🚀 Production deployment complete!' || '📦 Staging deployment complete!' }} | |
| Android Build: ${{ needs.build_android.outputs.build_id }} | |
| iOS Build: ${{ needs.build_ios.outputs.build_id }} | |
| env: | |
| SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment