Skip to content

Create preview.yml

Create preview.yml #3

Workflow file for this run

name: Create preview
on: [pull_request]
jobs:
preview:
name: Create preview
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "18.x"
cache: "yarn"
- uses: expo/[email protected]
with:
expo-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: Install dependencies
run: yarn
- name: Publish to Expo & create a QR code
uses: expo/expo-preview-action@v1
with:
channel: pr-${{ github.event.number }}
id: preview
- name: Comment deployment link
uses: unsplash/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
msg: >
You can [preview the PR here](${{ steps.preview.outputs.EXPO_QR_CODE_URL }}).<br><br>
<a href="${{ steps.publish.outputs.EXPO_QR_CODE_URL }}"><img src="${{ steps.preview.outputs.EXPO_QR_CODE_URL }}" height="512px" width="512px"></a>
<br><br>
QR code not working or need a different client? Try the QR code or deep link from the [project page](${{steps.preview.outputs.EXPO_PROJECT_URL}}).
<br><br>
${{ steps.publish.outputs.EXPO_NEW_BUILD_IS_REQUIRED_MESSAGE }}