app-cicd #8
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: app-cicd | |
# Add the workflow_dispatch event to allow manual triggering | |
on: | |
# Disable Github Action on Push due to the limit of EAS build, now use manual trigger during end of sprint | |
# push: | |
# Optional: You can keep the push trigger if you want it to also run on push | |
workflow_dispatch: | |
jobs: | |
update: | |
name: EAS Build APK | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check for EXPO_TOKEN | |
run: | | |
if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then | |
echo "You must provide an EXPO_TOKEN secret linked to this project's Expo account in this repo's secrets. Learn more: https://docs.expo.dev/eas-update/github-actions" | |
exit 1 | |
fi | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
cache: npm | |
- name: Check for package-lock.json | |
run: | | |
if [ ! -f package-lock.json ]; then | |
echo "Error: package-lock.json file is missing in the project directory." | |
exit 1 | |
fi | |
- name: Setup EAS | |
uses: expo/expo-github-action@v8 | |
with: | |
eas-version: latest | |
token: ${{ secrets.EXPO_TOKEN }} | |
- name: Install dependencies | |
run: npm install | |
- name: Build Android APK | |
run: eas build --platform android --profile preview --non-interactive |