CI/CD - Mise en place des workflows Gitea Actions #1

Merged
cedric merged 6 commits from dev into master 2026-05-16 07:55:45 +00:00
Showing only changes of commit 1d7c39973c - Show all commits
+50
View File
@@ -0,0 +1,50 @@
name: Vérification PR
run-name: Vérification PR de ${{ gitea.actor }}
on:
pull_request:
branches:
- master
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 Strapi
run: yarn build
deploy-beta:
needs: build
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.DEPLOY_PATH }}
git fetch origin
git checkout ${{ gitea.head.ref }}
git pull --ff-only origin ${{ gitea.head.ref }}
corepack enable
yarn install --frozen-lockfile
NODE_ENV=production yarn build
pm2 describe api-beta-pawol > /dev/null 2>&1 \
&& pm2 restart api-beta-pawol \
|| pm2 start yarn --name api-beta-pawol -- start