update staging from develop #6
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: 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 |