-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (86 loc) · 2.93 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
name: Déploiement sur l'espace de recette
on:
workflow_dispatch:
push:
branches: [recette]
env:
branch:
jobs:
dependencies:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.9.0]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Retrieve cached dependencies
id: retrieve-dependencies
uses: actions/cache@v3
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
- name: Cache dependencies if not present
if: steps.retrieve-dependencies.outputs.cache-hit == false
uses: actions/cache@v3
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@v3
with:
key: node_modules-${{ hashFiles('package-lock.json') }}
path: node_modules
- name: Override .env
uses: SpicyPizza/[email protected]
with:
envkey_REACT_APP_BLOG_URL: "https://media.conseiller-numerique.gouv.fr"
envkey_REACT_APP_DASHBOARD_URL: "https://beta.pilotage.conseiller-numerique.gouv.fr"
envkey_REACT_APP_COOP_URL: "https://beta.coop.conseiller-numerique.gouv.fr/login"
envkey_REACT_APP_CANDIDAT_URL: "https://beta.candidat.conseiller-numerique.gouv.fr/login"
envkey_REACT_APP_FORMS_URL: "https://uat-cnum-front.osc-fr1.scalingo.io/candidature"
envkey_REACT_APP_AIDE_URL: "https://aide.conseiller-numerique.gouv.fr/fr"
envkey_REACT_APP_API_URL: ${{ secrets.REACT_APP_API_RECETTE }}
file_name: .env
- 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@v3
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@v3
with:
name: bundle
path: build
- name: Deploy on clever cloud
uses: s0/git-publish-subdir-action@develop
env:
REPO: ${{ secrets.CLEVER_SITE_VITRINE_RECETTE }}
BRANCH: master
FOLDER: build
SSH_PRIVATE_KEY: ${{ secrets.CLEVER_CLOUD_DEPLOY_PRIVATE_KEY }}
KNOWN_HOSTS_FILE: resources/known_hosts