Good example of preview builds with EAS update using Github actions

Hi,

Does anyone have a good example of how to set up internal distribution, preview branches using GitHub actions and eas update?

At the moment I have a workflow that runs on push: “eas update --non-interactive --auto”
so that will create a channel and branch with the pr name. However, ideally its a branch within the preview channel, Does anyone know how to set the profile with eas update?

Or is this not the way to do this, and we should not use eas update, but keep using expo publish?

Hey @matthewford,

I’d suggest you to go through our docs on Distributing builds which conceptually explains how production and staging channels can be created: How EAS Update works - Expo Documentation

You can also check our migration guide from Classic Updates to EAS Updates: Migrating from Classic Updates to EAS Update - Expo Documentation and find more information on using GitHub actions here: Using GitHub Actions - Expo Documentation.

1 Like

@amanhimself Thanks, we’re already following the guidance however, when we load a build that was created via the example github action which uses eas update, what releaseChannel is that using?

Is there a way to select a profile/release channel with the update command via the Github Action?

The issue I’m seeing is that we have an env var switcher which loads an env var based on releaseChannel which is not picking anything up and falling back to ___DEV___ for builds generated via PRs

the naming changed to branch

❯ eas branch --help
manage update branches

USAGE
  $ eas branch:COMMAND

COMMANDS
  branch:create  create a branch
  branch:delete  delete a branch
  branch:list    list all branches
  branch:rename  rename a branch
  branch:view    view a branch

You can have a look at these slides done by @jonsamp

Is there a way to select a profile/release channel with the update command via the Github Action?

I think you can use

      - name: 📦 Install .env
        run: yarn env:staging

      - name: 🚀 Publish update
        run: eas update --branch staging

an on your package.json do

  "env:staging": "cp .env.staging .env",
1 Like