-
-
Notifications
You must be signed in to change notification settings - Fork 3
137 lines (132 loc) · 4.94 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: DEPLOY
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment'
required: true
type: choice
default: staging
options:
- staging
- production
type:
description: 'EAS deployment type'
required: true
type: choice
default: build
options:
- build
- update
comment:
description: 'Comment'
required: false
type: string
concurrency:
group: '${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true
run-name: '${{ github.event.inputs.type }} ${{ github.event.inputs.environment }} from ${{ github.ref_name }}'
env:
EAS_WORKFLOW_TYPE: ${{ github.event.inputs.type }}
WORFLOW_COMMENT_INPUT: ${{ github.event.inputs.comment }}
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
WORKFLOW_ENVIRONMENT: ${{ github.event.inputs.environment }}
LAST_COMMIT_MESSAGE: ${{ github.event.workflow_run.head_commit.message }}
BRANCH_NAME: ${{ github.ref_name }}
EAS_BUILD_PROFILE: ${{ github.event.inputs.environment }}
APP_STORE_BUNDLE_ID: fr.en-marche.jecoute
REF_TYPE: ${{ github.ref_type }}
EXPO_PUBLIC_API_BASE_URL: ${{secrets.EXPO_PUBLIC_API_BASE_URL}}
EXPO_PUBLIC_OAUTH_BASE_URL: ${{secrets.EXPO_PUBLIC_OAUTH_BASE_URL}}
EXPO_PUBLIC_OAUTH_CLIENT_ID: ${{secrets.EXPO_PUBLIC_OAUTH_CLIENT_ID}}
EXPO_PUBLIC_SENTRY_DSN: ${{secrets.EXPO_PUBLIC_SENTRY_DSN}}
EXPO_PUBLIC_FB_API_KEY: ${{secrets.EXPO_PUBLIC_FB_API_KEY}}
EXPO_PUBLIC_FB_PROJECT_ID: ${{secrets.EXPO_PUBLIC_FB_PROJECT_ID}}
EXPO_PUBLIC_FB_SENDER_ID: ${{secrets.EXPO_PUBLIC_FB_SENDER_ID}}
EXPO_PUBLIC_FB_APP_ID: ${{secrets.EXPO_PUBLIC_FB_APP_ID}}
EXPO_PUBLIC_FB_MEASUREMENT_ID: ${{secrets.EXPO_PUBLIC_FB_MEASUREMENT_ID}}
EXPO_PUBLIC_ENVIRONMENT: ${{secrets.EXPO_PUBLIC_ENVIRONMENT}}
EXPO_PUBLIC_ASSOCIATED_DOMAIN: ${{secrets.EXPO_PUBLIC_ASSOCIATED_DOMAIN}}
EXPO_PUBLIC_ADMIN_URL: ${{secrets.EXPO_PUBLIC_ADMIN_URL}}
EXPO_PUBLIC_MAP_BOX_ACCESS_TOKEN: ${{ secrets.EXPO_PUBLIC_MAP_BOX_ACCESS_TOKEN }}
EXPO_PUBLIC_APP_NAME: ${{ secrets.EXPO_PUBLIC_APP_NAME }}
EXPO_PUBLIC_CAMPAIGN_DOMAIN: ${{ secrets.EXPO_PUBLIC_CAMPAIGN_DOMAIN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
jobs:
build-web:
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.environment }}
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v4
- uses: ./.github/actions/setup-base
- uses: ./.github/actions/dependencies
- name: ⚙️ Compile web worker
run: yarn vite build --config vite.worker.config.js
- name: ⚙️ Compile web assets
uses: ./.github/actions/build-web
- name: ↗️ Upload web assets
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
- name: ↗️ Upload tamagui cache
uses: actions/upload-artifact@v4
with:
name: tamagui
path: .tamagui
deploy-web:
runs-on: ubuntu-latest
needs: build-web
environment: ${{ github.event.inputs.environment }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
name: ⬇️ Download web artifacts
- uses: ./.github/actions/setup-base
- uses: ./.github/actions/dependencies
- uses: google-github-actions/auth@v2
with:
create_credentials_file: true
credentials_json: ${{ secrets.GCP_SA_KEY_FIREBASE_DEPLOYER }}
- uses: ./.github/actions/deploy-firebase-live
id: deploy
name: 🚀 Send to firebase LIVE hosting
- name: 📢 Announce deployment
env:
URL: ${{steps.deploy.outputs.url}}
MAKE_WEBHOOK_URL: ${{ secrets.MAKE_WEBHOOK_URL }}
WORKFLOW_JOB: 'deploy_web'
run: node ./.github/scripts/announce.mjs
eas-mobile:
environment: ${{ github.event.inputs.environment }}
runs-on: ubuntu-latest
needs: build-web
env:
APP_STORE_BUNDLE_ID: fr.en-marche.jecoute
REF_TYPE: ${{ github.ref_type }}`
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v4
- uses: ./.github/actions/setup-base
- uses: ./.github/actions/dependencies
- uses: actions/download-artifact@v4
- uses: ./.github/actions/setup-env
name: ⬇️ Download web artifacts
- name: 🧙🏻️Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
packager: yarn
token: ${{ secrets.EXPO_TOKEN }}
- name: Insert envs into eas.json
run: node .github/scripts/prepare-eas-envs.mjs
- name: Build android & iOS
run: node .github/scripts/eas-deploy.mjs
- name: 📢 Announce deployment
env:
MAKE_WEBHOOK_URL: ${{ secrets.MAKE_WEBHOOK_URL }}
WORKFLOW_JOB: 'deploy_eas'
run: node ./.github/scripts/announce.mjs