Skip to content

Commit 5197ee2

Browse files
committed
chore: deploy pull requests to expo
1 parent 0ead266 commit 5197ee2

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

.github/workflows/expo-preview.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Expo Preview
2+
on: [pull_request]
3+
4+
jobs:
5+
publish:
6+
name: Install and publish
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v1
11+
12+
- name: Setup Node.js
13+
uses: actions/setup-node@v1
14+
with:
15+
node-version: 12.x
16+
17+
- name: Setup Expo
18+
uses: expo/expo-github-action@v5
19+
with:
20+
expo-version: 3.x
21+
expo-username: ${{ secrets.EXPO_CLI_USERNAME }}
22+
expo-password: ${{ secrets.EXPO_CLI_PASSWORD }}
23+
expo-cache: true
24+
25+
- name: Get yarn cache
26+
id: yarn-cache
27+
run: echo "::set-output name=dir::$(yarn cache dir)"
28+
29+
- name: Check yarn cache
30+
uses: actions/cache@v1
31+
with:
32+
path: ${{ steps.yarn-cache.outputs.dir }}
33+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-yarn-
36+
37+
- name: Install dependencies
38+
run: yarn
39+
40+
- name: Publish Expo app
41+
working-directory: ./example
42+
run: expo publish --release-channel=pr-${{ github.event.number }}
43+
44+
- name: Comment on PR
45+
uses: unsplash/comment-on-pr@master
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
with:
49+
msg: The Expo app for the example from this branch is ready!<br><br><a href="https://expo.io/@react-navigation/react-navigation-example?release-channel=pr-${{ github.event.number }}"><img src="https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=exp://exp.host/@react-navigation/react-navigation-example?release-channel=pr-${{ github.event.number }}" height="200px" width="200px"></a>.

example/app.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"displayName": "React Navigation Example",
44
"expo": {
55
"name": "@react-navigation/example",
6+
"owner": "react-navigation",
67
"slug": "react-navigation-example",
78
"description": "Demo app to showcase various functionality of React Navigation",
89
"privacy": "public",

0 commit comments

Comments
 (0)