EAS submit in github action CI/CD

  1. SDK Version: 46
  2. Platforms(Android/iOS/web/all): Android/IOS
  3. eas Version: eas-cli/2.2.1

Hello everyone,

I am trying to set an automatic submition of my app after build with the github action CI.
Here is the workflow:

name: Build and Submit
on:
  push:
    branches:
      - main
      - ci-test

jobs:
  build-and-submit:
    name: EAS Build and auto submit
    runs-on: ubuntu-latest
    steps:
      - name: Check for EXPO_TOKEN
        run: |
          if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then
            echo "You must provide an EXPO_TOKEN secret linked to this project's Expo account in this repo's secrets. Learn more: https://docs.expo.dev/eas-update/github-actions"
            exit 1
          fi
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Setup Node with yarn
        uses: actions/setup-node@v2
        with:
          node-version: 16.x
          cache: yarn

      - name: ✨ Setup Expo
        uses: expo/expo-github-action@v7
        with:
          expo-version: 6.x
          eas-version: latest
          token: ${{ secrets.EXPO_TOKEN }}

      - name: 📦 Install dependencies
        run: yarn install --frozen-lockfile

      - name: 🚀 Build on EAS
        run: eas build --profile production --platform all --non-interactive --auto-submit

I am using the --auto-submit option to directly submit after successfull build. My problem here is that I don’t know how to securely store the serviceAccountKeyPath file for android. I’m using a relative path locally to access it, but I don’t want to push this secret file on github. Is there any way to do this?

Here is my eas.json config for submit:

  "submit": {
    "production": {
      "ios": {},
      "android": {
        "serviceAccountKeyPath": "../api-keys/serviceAccountKeyPath.json"
      }
    },
  • Github actions support secrets, you can add it via webiste and inside github action write the env content to file. You can configure secret under https://github.com/[your-org]/[your-repo]/settings/secrets/actions
  • This field is optional if you want to manage your credentials, you can store that key in your expo account. Remove that field from eas.json, run submit on your machine, it should ask you about the key. After that, every submit from that project should use that key.

Thank you a lot, removing the field in eas.json make it store in expo account as you said. It is working on my CI now. I encounter another small problem from IOS, I was missing ascAppId in my eas.json file. After adding it everything worked perfectly.

1 Like