Skip to content

Commit

Permalink
chore: add EAS hosting for the example app
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric committed Jan 19, 2025
1 parent b7949d2 commit 8f558ae
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 2 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: deploy

on:
workflow_dispatch:
inputs:
target:
description: Deploy as preview or production
type: choice
required: true
default: preview
options:
- preview
- production
push:
branches: [main]
pull_request:
types: [opened, synchronize]

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true

env:
EXPO_USE_FAST_RESOLVER: true # Use the faster Metro resolver in SDK 51

jobs:
example:
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repository
uses: actions/checkout@v4

- name: 🏗 Setup monorepo
uses: ./.github/actions/setup-monorepo

- name: ✅ Build apps/example
run: pnpm run -w build:example

- name: 🌐 Export apps/example for web
working-directory: apps/example
run: pnpm expo export --platform web --output-dir ./build

# You can remove this step if you already configured this
# This project shouldn't be pre-configured with this ID, that's why its omitted
- name: 👷 Configure project
working-directory: apps/example
run: eas init --id d202a56f-0162-450d-af3b-a2d2e0678594 --force --non-interactive

- name: 🚀 Deploy apps/example preview
if: ${{ github.event_name == 'pull_request' || github.event.inputs.target == 'preview' }}
working-directory: apps/example
run: eas deploy --export-dir ./build

- name: 🚀 Deploy apps/example production
if: ${{ (github.event_name == 'push' && github.ref_name == 'main') || github.event.inputs.target == 'production' }}
working-directory: apps/example
run: eas deploy --export-dir ./build --production
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ You can use any package manager with Expo. If you want to use bun, yarn, or pnpm
## 👷 Workflows

- [`build`](./.github/workflows/build.yml) - Starts the EAS builds for **apps/example** using the given profile.
- [`deploy`](./.github/workflows/deploy.yml) - Deploys apps to a preview URL or production URL using [EAS Hosting](https://docs.expo.dev/eas/hosting/introduction/).
- [`preview`](./.github/workflows/preview.yml) - Publishes apps to a PR-specific release channel and adds a QR code to that PR.
- [`test`](./.github/workflows/test.yml) - Ensures that the apps and packages are healthy on multiple OSs.

Expand Down
4 changes: 2 additions & 2 deletions apps/example/app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"expo": {
"name": "example",
"slug": "example",
"name": "expo-monorepo",
"slug": "expo-monorepo",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
Expand Down

0 comments on commit 8f558ae

Please sign in to comment.