Skip to content

Commit 8c563ac

Browse files
committed
feat: add a gh action for publishing example on every PR
1 parent 5ef6739 commit 8c563ac

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Expo Review
2+
on: [pull_request]
3+
jobs:
4+
publish:
5+
name: Install and publish
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v1
10+
11+
- name: Setup Node.js
12+
uses: actions/setup-node@v1
13+
with:
14+
node-version: 12.x
15+
16+
- name: Setup Expo
17+
uses: expo/expo-github-action@v5
18+
with:
19+
expo-version: 3.x
20+
expo-username: ${{ secrets.EXPO_CLI_USERNAME_PAPER }}
21+
expo-password: ${{ secrets.EXPO_CLI_PASSWORD_PAPER }}
22+
expo-cache: true
23+
24+
- name: Get yarn cache
25+
id: yarn-cache
26+
run: echo "::set-output name=dir::$(yarn cache dir)"
27+
28+
- name: Check yarn cache
29+
uses: actions/cache@v1
30+
with:
31+
path: ${{ steps.yarn-cache.outputs.dir }}
32+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
33+
restore-keys: |
34+
${{ runner.os }}-yarn-
35+
36+
- name: Install dependencies
37+
run: yarn bootstrap
38+
39+
- name: Publish Expo app
40+
working-directory: ./example
41+
run: expo publish --release-channel=pr-${{ github.event.number }}
42+
43+
- name: Comment on PR
44+
uses: unsplash/comment-on-pr@master
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
with:
48+
msg: The mobile version of example app from this branch is ready! You can [see it here](https://expo.io/@react-native-paper/react-native-paper-example?release-channel=pr-${{ github.event.number }}).

0 commit comments

Comments
 (0)