Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

mobile-eas-preview.yml

83 lines2.8 KB

1name: Mobile EAS Preview
2​
3on:
4 pull_request:
5 types: [opened, reopened, synchronize, labeled, unlabeled]
6​
7jobs:
8 preview:
9 name: EAS Preview
10 if: contains(github.event.pull_request.labels.*.name, 'πŸš€ Mobile Continuous Deployment')
11 runs-on: blacksmith-8vcpu-ubuntu-2404
12 permissions:
13 contents: read
14 pull-requests: write
15 env:
16 APP_VARIANT: preview
17 NODE_OPTIONS: --max-old-space-size=8192
18 MOBILE_VERSION_POLICY: fingerprint
19 steps:
20 - id: expo-token
21 name: Check for EXPO_TOKEN
22 env:
23 EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
24 run: |
25 if [ -n "$EXPO_TOKEN" ]; then
26 echo "present=true" >> "$GITHUB_OUTPUT"
27 else
28 echo "present=false" >> "$GITHUB_OUTPUT"
29 echo "EXPO_TOKEN is not available; skipping EAS preview."
30 fi
31​
32 - name: Checkout
33 if: steps.expo-token.outputs.present == 'true'
34 uses: actions/checkout@v6
35 with:
36 fetch-depth: 0
37​
38 - name: Setup Vite+
39 if: steps.expo-token.outputs.present == 'true'
40 uses: voidzero-dev/setup-vp@v1
41 with:
42 node-version-file: package.json
43 cache: true
44 run-install: true
45​
46 - name: Expose pnpm
47 if: steps.expo-token.outputs.present == 'true'
48 run: |
49 pnpm_version="$(node --print "require('./package.json').packageManager.split('@').pop()")"
50 vp_pnpm_bin="$HOME/.vite-plus/package_manager/pnpm/$pnpm_version/pnpm/bin"
51 echo "$vp_pnpm_bin" >> "$GITHUB_PATH"
52 "$vp_pnpm_bin/pnpm" --version
53​
54 - name: Setup EAS
55 if: steps.expo-token.outputs.present == 'true'
56 uses: expo/expo-github-action@v8
57 with:
58 eas-version: latest
59 token: ${{ secrets.EXPO_TOKEN }}
60 # npm, not pnpm: this only installs eas-cli into the action's own
61 # tool dir, and pnpm 11 hard-fails that install on dtrace-provider's
62 # ignored build script (no allowBuilds config outside the repo).
63 packager: npm
64​
65 - name: Pull preview environment variables
66 if: steps.expo-token.outputs.present == 'true'
67 working-directory: apps/mobile
68 env:
69 EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
70 run: eas env:pull preview --non-interactive
71​
72 - name: Deploy with fingerprint check
73 if: steps.expo-token.outputs.present == 'true'
74 uses: expo/expo-github-action/continuous-deploy-fingerprint@main
75 env:
76 EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
77 with:
78 profile: preview:dev
79 branch: pr-${{ github.event.pull_request.number }}
80 platform: all
81 environment: preview
82 working-directory: apps/mobile
83 github-token: ${{ secrets.GITHUB_TOKEN }}