Files
topola-viewer/.github/workflows/deploy-wikitree-apps.yml
2026-05-08 16:18:40 +02:00

58 lines
1.6 KiB
YAML

name: Deploy to WikiTree Apps
on:
workflow_dispatch:
workflow_call:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm test
- name: Get Playwright version
id: playwright-version
run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> $GITHUB_OUTPUT
- name: Cache Playwright Browsers
id: cache-playwright
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}
- name: Install Playwright System Dependencies
run: npx playwright install-deps chromium
- name: Install Playwright Browsers (If Not Cached)
if: steps.cache-playwright.outputs.cache-hit != 'true'
run: npx playwright install chromium
- name: Run E2E Tests
run: npm run test:e2e
- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report-wikitree
path: playwright-report/
retention-days: 30
- name: Install lftp
run: sudo apt-get install -y lftp
- name: Set up ssh
run: |
mkdir ~/.ssh
echo 'apps-sftp.wikitree.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFr/n45SqtcLL2xou61C6UdmSeCYrQ01UlvS7ZzleFOD' >> ~/.ssh/known_hosts
- run: npm run deploy-wikitree
env:
LFTP_PASSWORD: ${{ secrets.WIKITREE_PASSWORD }}