Skip to content

Commit 8f558ae

Browse files
committed
chore: add EAS hosting for the example app
1 parent b7949d2 commit 8f558ae

File tree

3 files changed

+60
-2
lines changed

3 files changed

+60
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: deploy
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
target:
7+
description: Deploy as preview or production
8+
type: choice
9+
required: true
10+
default: preview
11+
options:
12+
- preview
13+
- production
14+
push:
15+
branches: [main]
16+
pull_request:
17+
types: [opened, synchronize]
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
21+
cancel-in-progress: true
22+
23+
env:
24+
EXPO_USE_FAST_RESOLVER: true # Use the faster Metro resolver in SDK 51
25+
26+
jobs:
27+
example:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: 🏗 Setup repository
31+
uses: actions/checkout@v4
32+
33+
- name: 🏗 Setup monorepo
34+
uses: ./.github/actions/setup-monorepo
35+
36+
- name: ✅ Build apps/example
37+
run: pnpm run -w build:example
38+
39+
- name: 🌐 Export apps/example for web
40+
working-directory: apps/example
41+
run: pnpm expo export --platform web --output-dir ./build
42+
43+
# You can remove this step if you already configured this
44+
# This project shouldn't be pre-configured with this ID, that's why its omitted
45+
- name: 👷 Configure project
46+
working-directory: apps/example
47+
run: eas init --id d202a56f-0162-450d-af3b-a2d2e0678594 --force --non-interactive
48+
49+
- name: 🚀 Deploy apps/example preview
50+
if: ${{ github.event_name == 'pull_request' || github.event.inputs.target == 'preview' }}
51+
working-directory: apps/example
52+
run: eas deploy --export-dir ./build
53+
54+
- name: 🚀 Deploy apps/example production
55+
if: ${{ (github.event_name == 'push' && github.ref_name == 'main') || github.event.inputs.target == 'production' }}
56+
working-directory: apps/example
57+
run: eas deploy --export-dir ./build --production

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ You can use any package manager with Expo. If you want to use bun, yarn, or pnpm
8686
## 👷 Workflows
8787

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

apps/example/app.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"expo": {
3-
"name": "example",
4-
"slug": "example",
3+
"name": "expo-monorepo",
4+
"slug": "expo-monorepo",
55
"version": "1.0.0",
66
"orientation": "portrait",
77
"icon": "./assets/images/icon.png",

0 commit comments

Comments
 (0)