feat: add preview and release ci #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build preview for pull requests | |
on: | |
push: | |
# REQUIRED: push main(default) branch is necessary for this action to update its fingerprint database | |
branches: [master] | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
# REQUIRED: limit concurrency when pushing main(default) branch to prevent conflict for this action to update its fingerprint database | |
concurrency: fingerprint-${{ github.event_name != 'pull_request' && 'master' || github.run_id }} | |
permissions: | |
# REQUIRED: Allow comments of PRs | |
pull-requests: write # Allow comments on PRs | |
# REQUIRED: Allow updating fingerprint in acton caches | |
actions: write | |
# Following permissions are required for private repos | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: 🏗 Setup EAS | |
uses: expo/expo-github-action@v8 | |
with: | |
eas-version: latest | |
token: ${{ secrets.EXPO_TOKEN }} | |
- name: Install dependencies | |
run: npm install | |
- name: 🚀 Create preview | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: expo/expo-github-action/preview@v8 | |
with: | |
command: eas update --auto --branch ${{ github.event.pull_request.head.ref }} | |
comment: true | |
qr-target: 'expo-go' | |
working-directory: ${{ github.workspace }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create preview builds if needed | |
uses: expo/expo-github-action/preview-build@main | |
with: | |
command: eas build --profile development --platform all | |