Merge pull request 'CI/CD & ajustements - Mise en place des workflows Gitea Actions' (#1) from dev into master
Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
@@ -0,0 +1,47 @@
|
|||||||
|
name: Vérification PR
|
||||||
|
run-name: Vérification PR de ${{ gitea.actor }}
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
|
||||||
|
- name: Activer Corepack (yarn)
|
||||||
|
run: corepack enable
|
||||||
|
|
||||||
|
- name: Vérifier les dépendances
|
||||||
|
run: yarn install --frozen-lockfile
|
||||||
|
|
||||||
|
deploy-beta:
|
||||||
|
needs: check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Pré-déployer sur BETA pour test
|
||||||
|
uses: appleboy/ssh-action@v1
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.SSH_HOST }}
|
||||||
|
username: ${{ secrets.SSH_USER }}
|
||||||
|
key: ${{ secrets.SSH_KEY }}
|
||||||
|
script: |
|
||||||
|
export NVM_DIR="$HOME/.nvm"
|
||||||
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||||
|
cd ${{ secrets.FRONT_DEPLOY_PATH }}
|
||||||
|
git fetch origin
|
||||||
|
git checkout ${{ gitea.head.ref }}
|
||||||
|
git pull --ff-only origin ${{ gitea.head.ref }}
|
||||||
|
corepack enable
|
||||||
|
yarn install --frozen-lockfile
|
||||||
|
yarn build
|
||||||
|
pm2 describe app-beta-pawol > /dev/null 2>&1 \
|
||||||
|
&& pm2 restart app-beta-pawol \
|
||||||
|
|| pm2 start yarn --name app-beta-pawol -- start -p ${{ secrets.DEV_PORT }}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
name: Déploiement FRONT BETA
|
||||||
|
run-name: ${{ gitea.actor }} déploie FRONT BETA
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
|
||||||
|
- name: Activer Corepack (yarn)
|
||||||
|
run: corepack enable
|
||||||
|
|
||||||
|
- name: Vérifier les dépendances
|
||||||
|
run: yarn install --frozen-lockfile
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
needs: check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Déployer sur le serveur
|
||||||
|
uses: appleboy/ssh-action@v1
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.SSH_HOST }}
|
||||||
|
username: ${{ secrets.SSH_USER }}
|
||||||
|
key: ${{ secrets.SSH_KEY }}
|
||||||
|
script: |
|
||||||
|
export NVM_DIR="$HOME/.nvm"
|
||||||
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||||
|
cd ${{ secrets.FRONT_DEPLOY_PATH }}
|
||||||
|
git pull --ff-only origin dev
|
||||||
|
corepack enable
|
||||||
|
yarn install --frozen-lockfile
|
||||||
|
yarn build
|
||||||
|
pm2 describe app-beta-pawol > /dev/null 2>&1 \
|
||||||
|
&& pm2 restart app-beta-pawol \
|
||||||
|
|| pm2 start yarn --name app-beta-pawol -- start -p ${{ secrets.DEV_PORT }}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
name: Déploiement FRONT PROD
|
||||||
|
run-name: ${{ gitea.actor }} déploie FRONT PROD
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
|
||||||
|
- name: Activer Corepack (yarn)
|
||||||
|
run: corepack enable
|
||||||
|
|
||||||
|
- name: Vérifier les dépendances
|
||||||
|
run: yarn install --frozen-lockfile
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
needs: check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Déployer sur le serveur
|
||||||
|
uses: appleboy/ssh-action@v1
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.SSH_HOST }}
|
||||||
|
username: ${{ secrets.SSH_USER }}
|
||||||
|
key: ${{ secrets.SSH_KEY }}
|
||||||
|
script: |
|
||||||
|
export NVM_DIR="$HOME/.nvm"
|
||||||
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||||
|
cd ${{ secrets.PROD_DEPLOY_PATH }}
|
||||||
|
git pull --ff-only origin master
|
||||||
|
corepack enable
|
||||||
|
yarn install --frozen-lockfile
|
||||||
|
yarn build
|
||||||
|
pm2 describe app-pawol > /dev/null 2>&1 \
|
||||||
|
&& pm2 restart app-pawol \
|
||||||
|
|| pm2 start yarn --name app-pawol -- start -p ${{ secrets.PROD_PORT }}
|
||||||
@@ -1,4 +1,15 @@
|
|||||||
export default function robots() {
|
export default function robots() {
|
||||||
|
const isProduction = process.env.NEXT_PUBLIC_ENV === 'production';
|
||||||
|
|
||||||
|
if (!isProduction) {
|
||||||
|
return {
|
||||||
|
rules: {
|
||||||
|
userAgent: '*',
|
||||||
|
disallow: '/',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
rules: {
|
rules: {
|
||||||
userAgent: '*',
|
userAgent: '*',
|
||||||
|
|||||||
+2
-2
@@ -15,9 +15,9 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "xo",
|
"lint": "xo",
|
||||||
"dev": "next dev -p 3001",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start -p 3001"
|
"start": "next start"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/cache": "^11.11.0",
|
"@emotion/cache": "^11.11.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user