11name : Preview Android Build (Feature Branch)
22
33on :
4- push :
5- branches :
6- - " **"
74 pull_request :
85 branches : [main]
6+ paths-ignore :
7+ - " **.md"
8+ - " docs/**"
9+ types : [opened, synchronize, reopened]
910
1011jobs :
1112 build :
13+ name : Build Android Preview
14+ # Only run this workflow for feature branches
15+ if : startsWith(github.head_ref, 'feature/')
1216 runs-on : ubuntu-latest
1317 steps :
14- - uses : actions/checkout@v3
15- - uses : actions/setup-node@v3
18+ - name : Checkout repository
19+ uses : actions/checkout@v3
20+
21+ - name : Setup Node
22+ uses : actions/setup-node@v3
1623 with :
1724 node-version : 18
18- cache : yarn
19-
25+ cache : yarn
2026
2127 - name : 🏗 Setup EAS
2228 uses : expo/expo-github-action@v8
@@ -27,20 +33,17 @@ jobs:
2733 - name : 📦 Install dependencies
2834 run : yarn install
2935
30-
31- - name : Trigger EAS Android build (preview)
36+ - name : Trigger EAS Android build (preview)
3237 id : eas_build
3338 run : |
3439 eas build --platform android --profile preview --non-interactive --json > build.json
3540 BUILD_URL=$(cat build.json | jq -r '.[0].artifacts.buildUrl')
3641 echo "BUILD_URL=$BUILD_URL" >> $GITHUB_ENV
3742
3843 - name : Post PR comment with preview link
39- if : github.event_name == 'pull_request'
4044 env :
4145 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
42- run : |
43- gh pr comment "$PR_URL" --body "🚀 Preview APK is ready! [Download here]($BUILD_URL)"
44- env :
4546 PR_URL : ${{ github.event.pull_request.html_url }}
46- BUILD_URL : ${{ env.BUILD_URL }}
47+ BUILD_URL : ${{ env.BUILD_URL }}
48+ run : |
49+ gh pr comment "$PR_URL" --body "🚀 Preview APK is ready! [Download here]($BUILD_URL)"
0 commit comments