EAS Build - Requested by @josh-leyshon (Run #5) #5
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: EAS Build | |
run-name: '${{ github.workflow }} - Requested by @${{github.actor}} (Run #${{github.run_number}})' | |
on: | |
workflow_dispatch: | |
issue_comment: | |
types: [created] | |
jobs: | |
build-android-preview: | |
name: Build Android (Preview) | |
if: | | |
${{ | |
github.event.issue.pull_request && | |
github.event.comment.user.login == 'josh-leyshon' && | |
contains(github.event.comment.body, '🏗 build-android-preview') | |
}} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get PR branch | |
if: github.event_name != 'workflow_dispatch' | |
uses: xt0rted/pull-request-comment-branch@v2 | |
id: pr-branch-info | |
- name: Set commit status as pending | |
if: github.event_name != 'workflow_dispatch' | |
uses: myrotvorets/[email protected] | |
with: | |
sha: ${{ steps.pr-branch-info.outputs.head_sha }} | |
status: pending | |
- name: Checkout PR branch | |
uses: actions/checkout@v3 | |
with: | |
ref: | | |
${{ | |
github.event_name != 'workflow_dispatch' && | |
steps.comment-branch.outputs.head_ref || | |
github.sha | |
}} | |
- name: Install Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
cache: npm | |
- name: Setup EAS | |
uses: expo/expo-github-action@v8 | |
with: | |
eas-version: latest | |
packager: npm | |
token: ${{ secrets.EXPO_TOKEN }} | |
- name: Install dependencies | |
run: npm ci | |
- name: 🏗 Build on EAS | |
run: eas build --platform android --profile preview --non-interactive | |
- name: Set final commit status | |
uses: myrotvorets/[email protected] | |
if: always() && github.event_name != 'workflow_dispatch' | |
with: | |
sha: ${{ steps.pr-branch-info.outputs.head_sha }} | |
status: ${{ job.status }} |