Skip to content

feat: complete

feat: complete #1

name: Update-Preview
on:
push:
branches:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
update:
name: EAS Update
runs-on: ubuntu-latest
environment: Preview
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@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: yarn
- name: Setup Expo
uses: expo/expo-github-action@v7
with:
expo-version: latest
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: Find yarn cache
id: yarn-cache-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore cache
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Create .env file
run: |
echo "${{ secrets.ENV_FILE }}" > .env
- name: Publish update
uses: expo/expo-github-action/preview@v8
with:
command: eas update --branch preview --auto
comment: false
env:
APP_MODE: preview
- name: Comment in Slack
run: node slack-update.js
env:
APP_MODE: preview
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}