From c7fd0e935d8e58bf204a36a9059eec47d87e58ae Mon Sep 17 00:00:00 2001 From: "ben@kilowatts.io" Date: Wed, 20 Dec 2023 21:49:04 +0000 Subject: [PATCH] create separate expo flows for production and preview --- .../{update.yml => expo_preview.yml} | 6 ++- .github/workflows/expo_production.yml | 45 +++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) rename .github/workflows/{update.yml => expo_preview.yml} (91%) create mode 100644 .github/workflows/expo_production.yml diff --git a/.github/workflows/update.yml b/.github/workflows/expo_preview.yml similarity index 91% rename from .github/workflows/update.yml rename to .github/workflows/expo_preview.yml index 2d72d2b..ebf7739 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/expo_preview.yml @@ -1,8 +1,7 @@ -name: update +name: expo_preview on: push: branches: - - production - preview workflow_run: workflows: ["test"] @@ -41,3 +40,6 @@ jobs: - name: Publish update run: eas update --auto + + - name: Build + run: eas build --platform all -e preview diff --git a/.github/workflows/expo_production.yml b/.github/workflows/expo_production.yml new file mode 100644 index 0000000..9e461c3 --- /dev/null +++ b/.github/workflows/expo_production.yml @@ -0,0 +1,45 @@ +name: expo_production +on: + push: + branches: + - production + workflow_run: + workflows: ["test"] + types: + - completed + +jobs: + update: + name: EAS Update + 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@v3 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 21.1.0 + cache: yarn + + - name: Setup EAS + uses: expo/expo-github-action@v8 + with: + eas-version: latest + token: ${{ secrets.EXPO_TOKEN }} + + - name: Install dependencies + run: yarn install + + - name: Publish update + run: eas update --auto + + - name: Build + run: eas build --platform all -e --auto-submit --auto-approve