Files
api.pawol.nu/.gitea/workflows/deploy-beta.yml
T
cedric 36da183404
Déploiement API BETA / build (push) Successful in 2m6s
Vérification PR / build (pull_request) Successful in 2m11s
Déploiement API BETA / deploy (push) Successful in 45s
Vérification PR / deploy-beta (pull_request) Successful in 44s
ci: deploy beta on all branches including master
2026-06-26 07:26:04 +04:00

48 lines
1.2 KiB
YAML

name: Déploiement API BETA
run-name: ${{ gitea.actor }} déploie API BETA
on:
push:
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:
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.DEPLOY_PATH }}
git fetch origin
git checkout -B ${{ gitea.ref_name }} origin/${{ gitea.ref_name }}
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