feat: cardmarket order fixes, edit, reimport, and article linking #64
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Deploy Nuxt 4 frontend (web/) to the VPS — Nitro node-server + PM2. | |
| # Required secrets: see deploy README or repo configuration message. | |
| name: Deploy web (Nuxt) | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'web/**' | |
| - '.github/workflows/deploy-web.yml' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'web/**' | |
| workflow_dispatch: | |
| concurrency: | |
| group: goupixdex-web-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-pr: | |
| name: Build (PR — sans déploiement) | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| defaults: | |
| run: | |
| working-directory: web | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| cache: npm | |
| cache-dependency-path: web/package-lock.json | |
| - name: Install & build | |
| env: | |
| NUXT_PUBLIC_API_BASE: https://example.com | |
| NUXT_PUBLIC_SITE_URL: https://example.com | |
| run: | | |
| npm ci | |
| npm run build | |
| deploy: | |
| name: Build & deploy | |
| if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' | |
| runs-on: ubuntu-latest | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| defaults: | |
| run: | |
| working-directory: web | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| cache: npm | |
| cache-dependency-path: web/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Write production .env (build) | |
| env: | |
| NUXT_PUBLIC_API_BASE: ${{ secrets.NUXT_PUBLIC_API_BASE }} | |
| NUXT_PUBLIC_SITE_URL: ${{ secrets.NUXT_PUBLIC_SITE_URL }} | |
| NUXT_PUBLIC_GITHUB_REPO: ${{ github.repository }} | |
| NUXT_PUBLIC_DESKTOP_RELEASE_CHANNEL: latest | |
| run: | | |
| { | |
| echo "NODE_ENV=production" | |
| echo "NUXT_PUBLIC_API_BASE=${NUXT_PUBLIC_API_BASE}" | |
| echo "NUXT_PUBLIC_SITE_URL=${NUXT_PUBLIC_SITE_URL}" | |
| echo "NUXT_PUBLIC_GITHUB_REPO=${NUXT_PUBLIC_GITHUB_REPO}" | |
| echo "NUXT_PUBLIC_DESKTOP_RELEASE_CHANNEL=${NUXT_PUBLIC_DESKTOP_RELEASE_CHANNEL}" | |
| } > .env | |
| - name: Build Nuxt (Nitro) | |
| env: | |
| NUXT_BUILD_COMMIT: ${{ github.sha }} | |
| run: npm run build | |
| - name: Pack .output | |
| working-directory: ${{ github.workspace }} | |
| run: tar -czf nuxt-output.tar.gz -C web .output | |
| - name: Upload bundle to VPS | |
| uses: appleboy/scp-action@v0.1.7 | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| port: ${{ secrets.SSH_PORT }} | |
| username: ${{ secrets.SSH_USERNAME }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| source: nuxt-output.tar.gz | |
| target: ${{ secrets.DEPLOY_WEB_DIR }} | |
| - name: Extract, PM2 & Nginx | |
| uses: appleboy/ssh-action@v1.0.3 | |
| env: | |
| DEPLOY_WEB_DIR: ${{ secrets.DEPLOY_WEB_DIR }} | |
| WEB_PM2_APP_NAME: ${{ secrets.WEB_PM2_APP_NAME }} | |
| WEB_APP_PORT: ${{ secrets.WEB_APP_PORT }} | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| port: ${{ secrets.SSH_PORT }} | |
| username: ${{ secrets.SSH_USERNAME }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| envs: DEPLOY_WEB_DIR,WEB_PM2_APP_NAME,WEB_APP_PORT | |
| script_stop: true | |
| script: | | |
| set -euo pipefail | |
| DEPLOY="${DEPLOY_WEB_DIR%/}" | |
| APP_NAME="${WEB_PM2_APP_NAME:-goupixdex-web}" | |
| WEB_PORT="${WEB_APP_PORT:-3000}" | |
| mkdir -p "$DEPLOY" | |
| tar -xzf "$DEPLOY/nuxt-output.tar.gz" -C "$DEPLOY" | |
| rm -f "$DEPLOY/nuxt-output.tar.gz" | |
| if ! command -v node >/dev/null 2>&1; then | |
| curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash - | |
| sudo apt-get install -y nodejs | |
| fi | |
| if ! command -v pm2 >/dev/null 2>&1; then | |
| sudo npm install -g pm2 | |
| fi | |
| cd "$DEPLOY/.output" | |
| pm2 describe "$APP_NAME" >/dev/null 2>&1 && pm2 delete "$APP_NAME" || true | |
| PORT="$WEB_PORT" HOST=127.0.0.1 NODE_ENV=production pm2 start server/index.mjs --name "$APP_NAME" | |
| pm2 save | |
| pm2 list | |
| sudo nginx -t | |
| sudo systemctl reload nginx |