Skip to content

Commit

Permalink
Passage à Vite
Browse files Browse the repository at this point in the history
  • Loading branch information
NerOcrO committed Jul 24, 2024
1 parent c1a7dda commit 693c9a0
Show file tree
Hide file tree
Showing 15 changed files with 3,673 additions and 14,747 deletions.
11 changes: 5 additions & 6 deletions .env
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Authentification
REACT_APP_API=http://localhost:8080
REACT_APP_STRATEGYAUTH=local
REACT_APP_CV_FILE_MAX_SIZE=10485760
REACT_APP_PIX_CAMPAGNE_URL=https://app.pix.fr/campagnes/1234
REACT_APP_PIX_URL=https://app.pix.fr/connexion
VITE_APP_API=http://localhost:8080
VITE_APP_STRATEGYAUTH=local
VITE_APP_CV_FILE_MAX_SIZE=10485760
VITE_APP_PIX_CAMPAGNE_URL=https://app.pix.fr/campagnes/1234
VITE_APP_PIX_URL=https://app.pix.fr/connexion
25 changes: 10 additions & 15 deletions .github/workflows/deploy-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,35 +42,30 @@ jobs:
- name: Override .env
uses: SpicyPizza/[email protected]
with:
envkey_REACT_APP_STRATEGYAUTH: "local"
envkey_REACT_APP_VERSION: "1.0"
envkey_REACT_APP_API: ${{ secrets.REACT_APP_API_DEMO }}
envkey_REACT_APP_CV_FILE_MAX_SIZE: 10485760
envkey_REACT_APP_PIX_CAMPAGNE_URL: ${{ secrets.REACT_APP_PIX_CAMPAGNE_URL }}
envkey_REACT_APP_PIX_URL: "https://app.pix.fr/connexion"
envkey_VITE_APP_STRATEGYAUTH: "local"
envkey_VITE_APP_VERSION: "1.0"
envkey_VITE_APP_API: ${{ secrets.VITE_APP_API_DEMO }}
envkey_VITE_APP_CV_FILE_MAX_SIZE: 10485760
envkey_VITE_APP_PIX_CAMPAGNE_URL: ${{ secrets.VITE_APP_PIX_CAMPAGNE_URL }}
envkey_VITE_APP_PIX_URL: "https://app.pix.fr/connexion"
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"
target: "dist/.htaccess"
- name: Upload release bundle as artifact
uses: actions/upload-artifact@v4
with:
name: bundle
path: build/*
path: dist/*

deploy:
needs: build
Expand All @@ -81,12 +76,12 @@ jobs:
uses: actions/download-artifact@v4
with:
name: bundle
path: build
path: dist
- name: Deploy on clever cloud
uses: s0/git-publish-subdir-action@develop
env:
REPO: ${{ secrets.CLEVER_CLOUD_GIT_PORTAIL_CANDIDAT_DEMO }}
BRANCH: master
FOLDER: build
FOLDER: dist
SSH_PRIVATE_KEY: ${{ secrets.CLEVER_CLOUD_DEPLOY_PRIVATE_KEY }}
KNOWN_HOSTS_FILE: resources/known_hosts
20 changes: 10 additions & 10 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,25 @@ jobs:
- name: Override .env
uses: SpicyPizza/[email protected]
with:
envkey_REACT_APP_STRATEGYAUTH: "local"
envkey_REACT_APP_VERSION: "1.0"
envkey_REACT_APP_API: ${{ secrets.REACT_APP_API_PRODUCTION }}
envkey_REACT_APP_CV_FILE_MAX_SIZE: 10485760
envkey_REACT_APP_PIX_CAMPAGNE_URL: ${{ secrets.REACT_APP_PIX_CAMPAGNE_URL }}
envkey_REACT_APP_PIX_URL: "https://app.pix.fr/connexion"
envkey_VITE_APP_STRATEGYAUTH: "local"
envkey_VITE_APP_VERSION: "1.0"
envkey_VITE_APP_API: ${{ secrets.VITE_APP_API_PRODUCTION }}
envkey_VITE_APP_CV_FILE_MAX_SIZE: 10485760
envkey_VITE_APP_PIX_CAMPAGNE_URL: ${{ secrets.VITE_APP_PIX_CAMPAGNE_URL }}
envkey_VITE_APP_PIX_URL: "https://app.pix.fr/connexion"
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"
target: "dist/.htaccess"
- name: Upload release bundle as artifact
uses: actions/upload-artifact@v4
with:
name: bundle
path: build/*
path: dist/*

deploy:
needs: build
Expand All @@ -71,12 +71,12 @@ jobs:
uses: actions/download-artifact@v4
with:
name: bundle
path: build
path: dist
- name: Deploy on clever cloud
uses: s0/git-publish-subdir-action@develop
env:
REPO: ${{ secrets.CLEVER_CLOUD_GIT_PORTAIL_CANDIDAT_PRODUCTION }}
BRANCH: master
FOLDER: build
FOLDER: dist
SSH_PRIVATE_KEY: ${{ secrets.CLEVER_CLOUD_DEPLOY_PRIVATE_KEY }}
KNOWN_HOSTS_FILE: resources/known_hosts
25 changes: 10 additions & 15 deletions .github/workflows/deploy-recette.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,35 +42,30 @@ jobs:
- name: Override .env
uses: SpicyPizza/[email protected]
with:
envkey_REACT_APP_STRATEGYAUTH: "local"
envkey_REACT_APP_VERSION: "1.0"
envkey_REACT_APP_API: ${{ secrets.REACT_APP_API_RECETTE }}
envkey_REACT_APP_CV_FILE_MAX_SIZE: 10485760
envkey_REACT_APP_PIX_CAMPAGNE_URL: ${{ secrets.REACT_APP_PIX_CAMPAGNE_URL }}
envkey_REACT_APP_PIX_URL: "https://app.pix.fr/connexion"
envkey_VITE_APP_STRATEGYAUTH: "local"
envkey_VITE_APP_VERSION: "1.0"
envkey_VITE_APP_API: ${{ secrets.VITE_APP_API_RECETTE }}
envkey_VITE_APP_CV_FILE_MAX_SIZE: 10485760
envkey_VITE_APP_PIX_CAMPAGNE_URL: ${{ secrets.VITE_APP_PIX_CAMPAGNE_URL }}
envkey_VITE_APP_PIX_URL: "https://app.pix.fr/connexion"
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"
target: "dist/.htaccess"
- name: Upload release bundle as artifact
uses: actions/upload-artifact@v4
with:
name: bundle
path: build/*
path: dist/*

deploy:
needs: build
Expand All @@ -81,12 +76,12 @@ jobs:
uses: actions/download-artifact@v4
with:
name: bundle
path: build
path: dist
- name: Deploy on clever cloud
uses: s0/git-publish-subdir-action@develop
env:
REPO: ${{ secrets.CLEVER_CLOUD_GIT_PORTAIL_CANDIDAT_RECETTE }}
BRANCH: master
FOLDER: build
FOLDER: dist
SSH_PRIVATE_KEY: ${{ secrets.CLEVER_CLOUD_DEPLOY_PRIVATE_KEY }}
KNOWN_HOSTS_FILE: resources/known_hosts
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/coverage

# production
/build
/dist

# Sub directories and index.html build by webpack
/public/fonts
Expand Down
43 changes: 0 additions & 43 deletions desindexation/index.html

This file was deleted.

34 changes: 34 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="fr" data-fr-reset data-fr-theme="light">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon-32.png" type="image/png" sizes="32x32" />
<link rel="icon" href="/favicon-64.png" type="image/png" sizes="64x64" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="espace candidat" />
<link rel="manifest" href="/manifest.json" />
<title>Espace Conseiller Numérique</title>
<meta name="google-site-verification" content="eND3WF_iW6YzE4bYPRUYnRxnMR_5cyk54SOAB50HVug" />
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script>
var _paq = window._paq = window._paq || [];
_paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
_paq.push(["setCookieDomain", "*.conseiller-numerique.gouv.fr"]);
_paq.push(["setDomains", ["*.conseiller-numerique.gouv.fr"]]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://stats.data.gouv.fr/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '147']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<script type="module" src="/src/index.js"></script>
</body>
</html>
Loading

0 comments on commit 693c9a0

Please sign in to comment.