Files
electron-rare.github.io/.github/workflows/deploy-ovh-ftp.yml
T
Clément SAILLANT efcf5aac62 fix(ci): inline build+deploy, remove missing script reference
The workflow was calling deploy-ovh-ftp-target.sh which doesn't exist
on this branch. Replace with inline astro build + lftp mirror.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 09:45:21 +01:00

74 lines
1.8 KiB
YAML

name: Deploy External Site to OVH FTP
on:
workflow_dispatch:
inputs:
target:
description: Deployment target
required: true
default: preview
type: choice
options:
- preview
- production
permissions:
contents: read
concurrency:
group: ovh-ftp-${{ inputs.target }}
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
env:
FTP_HOST: ${{ secrets.OVH_FTP_HOST }}
FTP_USER: ${{ secrets.OVH_FTP_USER }}
FTP_PASS: ${{ secrets.OVH_FTP_PASS }}
FTP_PORT: ${{ secrets.OVH_FTP_PORT }}
FTP_REMOTE_DIR: ${{ secrets.OVH_FTP_REMOTE_DIR }}
PUBLIC_SITE_URL_PROD: ${{ vars.PUBLIC_SITE_URL_PROD }}
PUBLIC_SITE_URL_PREVIEW: ${{ vars.PUBLIC_SITE_URL_PREVIEW }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: |
package-lock.json
apps/lab-interactif/package-lock.json
- name: Install root dependencies
run: npm ci
- name: Install lab dependencies
run: npm ci --prefix apps/lab-interactif
- name: Install lftp
run: |
sudo apt-get update
sudo apt-get install -y lftp
- name: Build static site
env:
PUBLIC_SITE_URL: https://www.lelectronrare.fr/
run: npm run build:astro
- name: Deploy to OVH
run: |
lftp -u "$FTP_USER","$FTP_PASS" "ftp://$FTP_HOST" <<EOF
set ssl:verify-certificate no
set ftp:list-options -a
set cmd:fail-exit true
set net:max-retries 3
set net:timeout 30
mirror --reverse --delete --verbose dist/ ${FTP_REMOTE_DIR:-/www}
bye
EOF