This repository has been archived by the owner on Nov 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (116 loc) · 4.57 KB
/
deploy-recette.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
name: Déploiement en recette
on:
push:
branches: [recette]
jobs:
dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: npm
node-version-file: package.json
- name: Retrieve cached dependencies
id: retrieve-dependencies
uses: actions/cache@v4
with:
key: node_modules-${{ hashFiles('package-lock.json') }}
path: node_modules
- name: Install dependencies
if: steps.retrieve-dependencies.outputs.cache-hit == false
run: npm ci --omit=dev
- name: Cache dependencies if not present
if: steps.retrieve-dependencies.outputs.cache-hit == false
uses: actions/cache@v4
with:
key: node_modules.-${{ hashFiles('package-lock.json') }}
path: node_modules
build:
needs: dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Retrieve cached dependencies
uses: actions/cache@v4
with:
key: node_modules-${{ hashFiles('package-lock.json') }}
path: node_modules
- name: Override .env
uses: SpicyPizza/[email protected]
with:
envkey_REACT_APP_STRATEGYAUTH: "local"
envkey_REACT_APP_VERSION: "1.2"
envkey_REACT_APP_WEBMAIL_URL: "http://webmail.conseiller-numerique.fr"
envkey_REACT_APP_MATTERMOST_URL: "https://beta.discussion.conseiller-numerique.gouv.fr"
envkey_REACT_APP_API: ${{ secrets.REACT_APP_API_RECETTE }}
envkey_REACT_APP_PIX_URL: "https://pix.fr/abc-pix-cnfs/"
envkey_REACT_APP_PIX_CONNEXION_URL: "https://app.pix.fr/connexion"
envkey_REACT_APP_PIX_CAMPAGNE_URL: ${{ secrets.REACT_APP_PIX_CAMPAGNE_URL }}
envkey_REACT_APP_LABASE_URL: "https://lesbases.anct.gouv.fr/bases/conseiller-numerique"
envkey_REACT_APP_AIDE_URL: "https://aide.conseiller-numerique.gouv.fr/fr"
envkey_REACT_APP_CARTOGRAPHIE_URL: "https://beta.www.conseiller-numerique.gouv.fr/carte"
envkey_REACT_APP_RDV_AIDE_NUMERIQUE_URL: "https://www.rdv-aide-numerique.fr/agents/sign_in"
envkey_REACT_APP_BLOG_URL: "https://media.conseiller-numerique.gouv.fr"
envkey_REACT_APP_ESPACE_COOP_URL: "https://beta.coop.conseiller-numerique.gouv.fr"
envkey_REACT_APP_TABLEAU_DE_PILOTAGE_URL: "https://beta.pilotage.conseiller-numerique.gouv.fr"
envkey_REACT_APP_NOMBRE_LIEU_SECONDAIRE: 15
envkey_REACT_APP_INIT_COORDONNEES: 1.849121,46.624100
envkey_REACT_APP_CV_FILE_MAX_SIZE: 10485760
envkey_REACT_APP_SENTRY_ENABLED: "true"
envkey_REACT_APP_SENTRY_ENVIRONMENT: "recette"
envkey_REACT_APP_SENTRY_DSN: ${{ secrets.SENTRY_COOP_DSN }}
envkey_REACT_APP_SENTRY_TRACE_RATE: "0.01"
file_name: .env
- name: copy robots.txt
uses: canastro/copy-file-action@master
with:
source: "desindexation/robots.txt"
target: "public/robots.txt"
- name: copy index.html
uses: canastro/copy-file-action@master
with:
source: "desindexation/index.html"
target: "public/index.html"
- name: Build application
run: npm run build
- name: copy .htaccess
uses: canastro/copy-file-action@master
with:
source: ".htaccess"
target: "build/.htaccess"
- name: Upload release bundle as artifact
uses: actions/upload-artifact@v4
with:
name: bundle
path: build/*
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Retrieve bundle React
uses: actions/download-artifact@v4
with:
name: bundle
path: build
- name: Deploy on clever cloud
uses: s0/git-publish-subdir-action@develop
env:
REPO: ${{ secrets.CLEVER_CLOUD_GIT_PORTAIL_CONSEILLER_RECETTE }}
BRANCH: master
FOLDER: build
SSH_PRIVATE_KEY: ${{ secrets.CLEVER_CLOUD_DEPLOY_PRIVATE_KEY }}
KNOWN_HOSTS_FILE: resources/known_hosts
- uses: actions/checkout@v4
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_BETA_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_BETA_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_COOP_PROJECT }}
SENTRY_URL: ${{ secrets.SENTRY_BETA_URL }}
with:
environment: recette
ignore_missing: true
ignore_empty: true