name: Create EAS Update on Push to Main
on:
push:
branches:
- main
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v3
- name: 🏗 Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: yarn
- name: 🏗 Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: 📦 Install dependencies
run: yarn install
- name: 🚀 Create update
run: eas update --auto --non-interactive
Expo GitHub Action
Publish, build or manage your Expo app with GitHub Actions.
What is Expo GitHub Action?
Expo GitHub Action enables you to automate publishing, building, and managing your Expo app using Expo CLI and EAS CLI. With full access to both CLI tools, you can streamline tasks like creating EAS updates or builds directly from your GitHub workflows.
Key Features
- Automate Expo CLI and EAS CLI commands such as
eas update
oreas build
. - Caching support for faster builds.
- Token-based authentication for secure Expo access.
How to Create New EAS Update on Push to Main
This workflow listens to push events on the main branch, setting up authentication and the necessary environment to create an EAS update.
on:
push:
branches:
- main
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v3
- name: 🏗 Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: yarn
- name: 🏗 Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: 📦 Install dependencies
run: yarn install
- name: 🚀 Create update
run: eas update --auto --non-interactive
How to Create New EAS Build on Push to Main
This workflow allows you to create an EAS build whenever code is pushed to the main branch. By setting the eas-version
, it installs the latest version of the EAS CLI for your build process.
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v3
- name: 🏗 Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: yarn
- name: 🏗 Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: 📦 Install dependencies
run: yarn install
- name: 🚀 Build app
run: eas build --non-interactive
How to Create Previews on Pull Requests
This workflow publishes a preview of the app for pull request reviews. It automates the preview creation process by triggering an EAS update.
on: [pull_request]
jobs:
preview:
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v3
- name: 🏗 Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: yarn
- name: 🏗 Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: 📦 Install dependencies
run: yarn install
- name: 🚀 Create preview
uses: expo/expo-github-action/preview@v8
with:
command: eas update --auto --branch ${{ github.event.pull_request.head.ref }}
How to Authenticate Expo Commands Automatically
Expo commands like expo publish
and eas build
require authentication. You can authenticate within your workflow by setting up the EXPO_TOKEN
as a GitHub secret. This token ensures you are logged into Expo in every workflow step.
How to Use Built-in Cache for Faster Builds
This action supports caching to speed up your builds by restoring previous Expo and EAS CLI installations. The caching mechanism is based on GitHub Actions cache, reducing installation times.
with:
eas-cache: true
How to Prevent ENOSPC Errors on Linux
If you're using Ubuntu and encounter ENOSPC
errors due to memory limits, the patch-watchers
option allows you to increase file system availability. This option is enabled by default but can be disabled if needed.
with:
patch-watchers: false
This structure provides detailed guidance on how to use Expo GitHub Action, including workflows for creating updates, builds, previews, and handling authentication, caching, and errors.
Monitoring GitHub Actions Workflows
CICube is a GitHub Actions monitoring tool that provides you with detailed insights into your workflows to further optimize your CI/CD pipeline. With CICube, you will be able to track your workflow runs, understand where the bottlenecks are, and tease out the best from your build times. Go to cicube.io now and create a free account to better optimize your GitHub Actions workflows!