Skip to content

Instantly share code, notes, and snippets.

@raulmelo
Created April 15, 2024 01:13
Show Gist options
  • Save raulmelo/c0dc39300a6b28e303393d6b6ac69a18 to your computer and use it in GitHub Desktop.
Save raulmelo/c0dc39300a6b28e303393d6b6ac69a18 to your computer and use it in GitHub Desktop.
name: Deploy to Expo
on:
push:
branches:
- main
- release/*
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Check for TOKEN_EXPO
shell: bash
run: |
if [ -z "${{ secrets.TOKEN_EXPO }}" ]; 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: Setup Expo
uses: expo/expo-github-action@v7
with:
expo-version: latest
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: npm config set legacy-peer-deps true
run: npm config set legacy-peer-deps true
- name: npm install
run: npm install
- name: npm install global
run: npm install expo-cli eas-cli -g
- name: Expo login
env:
EXPO_USER: ti.borasolucoes@gmail.com
EXPO_PASSWORD: ${{ secrets.EXPO_PASSWORD }}
run: |
expo login --username $EXPO_USER --password $EXPO_PASSWORD
- name: Deploy to Expo development
if: startsWith(github.ref, 'refs/heads/release/')
run: ENV=DEV eas update --branch development --non-interactive --message '${{ github.event.head_commit.message }}'
- name: Deploy to Expo production
if: ${{ github.ref == 'refs/heads/main'}}
run: eas update --channel production --platform all --non-interactive --message '${{ github.event.head_commit.message }}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment