Merge pull request #1533 from betagouv/20240924_proconnect #1869
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: Frontend build | |
on: push | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
defaults: | |
run: | |
working-directory: frontend | |
strategy: | |
matrix: | |
include: | |
- env: sandbox1 | |
back_host: https://back.sandbox1.datapass.api.gouv.fr | |
api_gouv_host: https://staging.api.gouv.fr | |
piwik_url: "" | |
piwik_site_id: "" | |
- env: sandbox2 | |
back_host: https://back.sandbox2.datapass.api.gouv.fr | |
api_gouv_host: https://staging.api.gouv.fr | |
piwik_url: "" | |
piwik_site_id: "" | |
- env: sandbox3 | |
back_host: https://back.sandbox3.datapass.api.gouv.fr | |
api_gouv_host: https://staging.api.gouv.fr | |
piwik_url: "" | |
piwik_site_id: "" | |
- env: sandbox4 | |
back_host: https://back.sandbox4.datapass.api.gouv.fr | |
api_gouv_host: https://staging.api.gouv.fr | |
piwik_url: "" | |
piwik_site_id: "" | |
- env: sandbox5 | |
back_host: https://back.sandbox5.datapass.api.gouv.fr | |
api_gouv_host: https://staging.api.gouv.fr | |
piwik_url: "" | |
piwik_site_id: "" | |
- env: staging1 | |
back_host: https://back.staging1.datapass.api.gouv.fr | |
api_gouv_host: https://staging.api.gouv.fr | |
piwik_url: "" | |
piwik_site_id: "" | |
react_app_api_entreprise_redirect_to_v2_host: https://staging.api-entreprise.v2.datapass.api.gouv.fr | |
react_app_api_particulier_redirect_to_v2_host: https://staging.api-particulier.v2.datapass.api.gouv.fr | |
react_app_hubee_portail_redirect_to_v2_host: https://staging.hubee.v2.datapass.api.gouv.fr/formulaires/hubee-cert-dc/demande/nouveau | |
react_app_hubee_portail_dila_redirect_to_v2_host: https://staging.hubee.v2.datapass.api.gouv.fr/formulaires/hubee-dila/demande/nouveau | |
- env: staging2 | |
back_host: https://back.staging2.datapass.api.gouv.fr | |
api_gouv_host: https://staging.api.gouv.fr | |
piwik_url: "" | |
piwik_site_id: "" | |
react_app_api_entreprise_redirect_to_v2_host: https://staging.api-entreprise.v2.datapass.api.gouv.fr | |
react_app_api_particulier_redirect_to_v2_host: https://staging.api-particulier.v2.datapass.api.gouv.fr | |
react_app_hubee_portail_redirect_to_v2_host: https://staging.hubee.v2.datapass.api.gouv.fr/formulaires/hubee-cert-dc/demande/nouveau | |
react_app_hubee_portail_dila_redirect_to_v2_host: https://staging.hubee.v2.datapass.api.gouv.fr/formulaires/hubee-dila/demande/nouveau | |
- env: staging3 | |
back_host: https://back.staging3.datapass.api.gouv.fr | |
api_gouv_host: https://staging.api.gouv.fr | |
piwik_url: "" | |
piwik_site_id: "" | |
react_app_api_entreprise_redirect_to_v2_host: https://staging.api-entreprise.v2.datapass.api.gouv.fr | |
react_app_api_particulier_redirect_to_v2_host: https://staging.api-particulier.v2.datapass.api.gouv.fr | |
react_app_hubee_portail_redirect_to_v2_host: https://staging.hubee.v2.datapass.api.gouv.fr/formulaires/hubee-cert-dc/demande/nouveau | |
react_app_hubee_portail_dila_redirect_to_v2_host: https://staging.hubee.v2.datapass.api.gouv.fr/formulaires/hubee-dila/demande/nouveau | |
- env: staging4 | |
back_host: https://back.staging4.datapass.api.gouv.fr | |
api_gouv_host: https://staging.api.gouv.fr | |
piwik_url: "" | |
piwik_site_id: "" | |
react_app_api_entreprise_redirect_to_v2_host: https://staging.api-entreprise.v2.datapass.api.gouv.fr | |
react_app_api_particulier_redirect_to_v2_host: https://staging.api-particulier.v2.datapass.api.gouv.fr | |
react_app_hubee_portail_redirect_to_v2_host: https://staging.hubee.v2.datapass.api.gouv.fr/formulaires/hubee-cert-dc/demande/nouveau | |
react_app_hubee_portail_dila_redirect_to_v2_host: https://staging.hubee.v2.datapass.api.gouv.fr/formulaires/hubee-dila/demande/nouveau | |
- env: staging5 | |
back_host: https://back.staging5.datapass.api.gouv.fr | |
api_gouv_host: https://staging.api.gouv.fr | |
piwik_url: "" | |
piwik_site_id: "" | |
react_app_api_entreprise_redirect_to_v2_host: https://staging.api-entreprise.v2.datapass.api.gouv.fr | |
react_app_api_particulier_redirect_to_v2_host: https://staging.api-particulier.v2.datapass.api.gouv.fr | |
react_app_hubee_portail_redirect_to_v2_host: https://staging.hubee.v2.datapass.api.gouv.fr/formulaires/hubee-cert-dc/demande/nouveau | |
react_app_hubee_portail_dila_redirect_to_v2_host: https://staging.hubee.v2.datapass.api.gouv.fr/formulaires/hubee-dila/demande/nouveau | |
- env: production1 | |
back_host: https://back.datapass.api.gouv.fr | |
api_gouv_host: https://api.gouv.fr | |
piwik_url: https://stats.data.gouv.fr | |
piwik_site_id: "53" | |
react_app_api_entreprise_redirect_to_v2_host: https://api-entreprise.v2.datapass.api.gouv.fr | |
react_app_api_particulier_redirect_to_v2_host: https://api-particulier.v2.datapass.api.gouv.fr | |
react_app_hubee_portail_redirect_to_v2_host: https://hubee.v2.datapass.api.gouv.fr/formulaires/hubee-cert-dc/demande/nouveau | |
react_app_hubee_portail_dila_redirect_to_v2_host: https://hubee.v2.datapass.api.gouv.fr/formulaires/hubee-dila/demande/nouveau | |
- env: production2 | |
back_host: https://back.datapass.api.gouv.fr | |
api_gouv_host: https://api.gouv.fr | |
piwik_url: https://stats.data.gouv.fr | |
piwik_site_id: "53" | |
react_app_api_entreprise_redirect_to_v2_host: https://api-entreprise.v2.datapass.api.gouv.fr | |
react_app_api_particulier_redirect_to_v2_host: https://api-particulier.v2.datapass.api.gouv.fr | |
react_app_hubee_portail_redirect_to_v2_host: https://hubee.v2.datapass.api.gouv.fr/formulaires/hubee-cert-dc/demande/nouveau | |
react_app_hubee_portail_dila_redirect_to_v2_host: https://hubee.v2.datapass.api.gouv.fr/formulaires/hubee-dila/demande/nouveau | |
- env: production3 | |
back_host: https://back.datapass.api.gouv.fr | |
api_gouv_host: https://api.gouv.fr | |
piwik_url: https://stats.data.gouv.fr | |
piwik_site_id: "53" | |
react_app_api_entreprise_redirect_to_v2_host: https://api-entreprise.v2.datapass.api.gouv.fr | |
react_app_api_particulier_redirect_to_v2_host: https://api-particulier.v2.datapass.api.gouv.fr | |
react_app_hubee_portail_redirect_to_v2_host: https://hubee.v2.datapass.api.gouv.fr/formulaires/hubee-cert-dc/demande/nouveau | |
react_app_hubee_portail_dila_redirect_to_v2_host: https://hubee.v2.datapass.api.gouv.fr/formulaires/hubee-dila/demande/nouveau | |
- env: production4 | |
back_host: https://back.datapass.api.gouv.fr | |
api_gouv_host: https://api.gouv.fr | |
piwik_url: https://stats.data.gouv.fr | |
piwik_site_id: "53" | |
react_app_api_entreprise_redirect_to_v2_host: https://api-entreprise.v2.datapass.api.gouv.fr | |
react_app_api_particulier_redirect_to_v2_host: https://api-particulier.v2.datapass.api.gouv.fr | |
react_app_hubee_portail_redirect_to_v2_host: https://hubee.v2.datapass.api.gouv.fr/formulaires/hubee-cert-dc/demande/nouveau | |
react_app_hubee_portail_dila_redirect_to_v2_host: https://hubee.v2.datapass.api.gouv.fr/formulaires/hubee-dila/demande/nouveau | |
- env: production5 | |
back_host: https://back.datapass.api.gouv.fr | |
api_gouv_host: https://api.gouv.fr | |
piwik_url: https://stats.data.gouv.fr | |
piwik_site_id: "53" | |
react_app_api_entreprise_redirect_to_v2_host: https://api-entreprise.v2.datapass.api.gouv.fr | |
react_app_api_particulier_redirect_to_v2_host: https://api-particulier.v2.datapass.api.gouv.fr | |
react_app_hubee_portail_redirect_to_v2_host: https://hubee.v2.datapass.api.gouv.fr/formulaires/hubee-cert-dc/demande/nouveau | |
react_app_hubee_portail_dila_redirect_to_v2_host: https://hubee.v2.datapass.api.gouv.fr/formulaires/hubee-dila/demande/nouveau | |
- env: production | |
back_host: https://back.datapass.api.gouv.fr | |
api_gouv_host: https://api.gouv.fr | |
piwik_url: https://stats.data.gouv.fr | |
piwik_site_id: "53" | |
react_app_api_entreprise_redirect_to_v2_host: https://api-entreprise.v2.datapass.api.gouv.fr | |
react_app_api_particulier_redirect_to_v2_host: https://api-particulier.v2.datapass.api.gouv.fr | |
react_app_hubee_portail_redirect_to_v2_host: https://hubee.v2.datapass.api.gouv.fr/formulaires/hubee-cert-dc/demande/nouveau | |
react_app_hubee_portail_dila_redirect_to_v2_host: https://hubee.v2.datapass.api.gouv.fr/formulaires/hubee-dila/demande/nouveau | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16.x" | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- run: npm install | |
- run: npm run build | |
env: | |
REACT_APP_NODE_ENV: production | |
REACT_APP_BACK_HOST: ${{ matrix.back_host }} | |
REACT_APP_API_GOUV_HOST: ${{ matrix.api_gouv_host }} | |
REACT_APP_PIWIK_URL: ${{ matrix.piwik_url }} | |
REACT_APP_PIWIK_SITE_ID: ${{ matrix.piwik_site_id }} | |
REACT_APP_API_ENTREPRISE_REDIRECT_TO_V2_HOST: ${{ matrix.react_app_api_entreprise_redirect_to_v2_host }} | |
REACT_APP_API_PARTICULIER_REDIRECT_TO_V2_HOST: ${{ matrix.react_app_api_particulier_redirect_to_v2_host }} | |
REACT_APP_HUBEE_PORTAIL_REDIRECT_TO_V2_HOST: ${{ matrix.react_app_hubee_portail_redirect_to_v2_host }} | |
REACT_APP_HUBEE_PORTAIL_DILA_REDIRECT_TO_V2_HOST: ${{ matrix.react_app_hubee_portail_dila_redirect_to_v2_host }} | |
- name: Archive build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.env }}-${{ github.sha }}-build | |
path: | | |
frontend/build |