deploy: create workflow
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
name: Déploiement FRONT BETA
|
||||
run-name: ${{ gitea.actor }} déploie FRONT BETA
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
|
||||
jobs:
|
||||
build:
|
||||
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: Installer les dépendances
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Build Next.js
|
||||
run: yarn build
|
||||
|
||||
deploy:
|
||||
needs: build
|
||||
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 restart app-beta-pawol
|
||||
Reference in New Issue
Block a user