Add Aptabase for analytics & event tracking #34
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: Main | |
on: | |
push: | |
branches: ["main"] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
name: Lint | |
steps: | |
- name: Checkout Too Many Men | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
cache: "yarn" | |
- name: Install Dependencies | |
run: yarn install | |
- name: Lint | |
run: yarn lint | |
type-check: | |
runs-on: ubuntu-latest | |
name: Type Check | |
steps: | |
- name: Checkout Too Many Men | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
cache: "yarn" | |
- name: Install Dependencies | |
run: yarn install | |
- name: Type Check | |
run: yarn tsc | |
check-prettier: | |
runs-on: ubuntu-latest | |
name: Prettier Check | |
steps: | |
- name: Checkout Too Many Men | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
cache: "yarn" | |
- name: Install Dependencies | |
run: yarn install | |
- name: Prettier Check | |
run: yarn prettier-check | |
test: | |
runs-on: ubuntu-latest | |
name: Test | |
steps: | |
- name: Checkout Too Many Men | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
cache: "yarn" | |
- name: Install Dependencies | |
run: yarn install | |
- name: Test | |
run: EXPO_PUBLIC_API_URL=http://localhost:3000 yarn test --collectCoverage | |
# https://docs.expo.dev/eas-update/github-actions/ | |
mobile-deploy: | |
needs: [lint, type-check, check-prettier, test] | |
name: iOS & Android Deploy | |
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 Too Many Men | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
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 --branch preview --auto | |
web-deploy: | |
name: Web Deploy | |
needs: [lint, type-check, check-prettier, test] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout Too Many Men | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
cache: "yarn" | |
- name: Install Dependencies | |
run: yarn install | |
- name: Build Web App | |
run: EXPO_PUBLIC_API_URL=https://too-many-men-api-8dcb4a385e6b.herokuapp.com npx expo export -p web | |
- name: Deploy to Netlify | |
uses: nwtgck/[email protected] | |
with: | |
publish-dir: "./dist" | |
production-branch: main | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
deploy-message: ${{ github.event.head_commit.message }} | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
timeout-minutes: 1 |