fix: correct docs-deploy workflow YAML formatting #3
Workflow file for this run
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
name: Deploy Documentation to Netcup | ||
Check failure on line 1 in .github/workflows/docs-deploy.yml
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'docs-site/**' | ||
workflow_dispatch: | ||
inputs: | ||
force_deploy: | ||
description: 'Force deployment even if no docs-site changes' | ||
required: false | ||
default: 'false' | ||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
# Only run on main branch to prevent accidental deployments | ||
if: github.ref == 'refs/heads/main' | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
cache: 'npm' | ||
cache-dependency-path: docs-site/package-lock.json | ||
- name: Install dependencies | ||
run: | | ||
cd docs-site | ||
npm ci | ||
- name: Build documentation site | ||
run: | | ||
cd docs-site | ||
npm run build | ||
- name: Deploy to Netcup hosting | ||
# Only deploy if secrets are available | ||
if: ${{ secrets.NETCUP_URI && secrets.NETCUP_USER && secrets.NETCUP_PASSWORD }} | ||
uses: SamKirkland/FTP-Deploy-Action@v4.3.4 | ||
with: | ||
server: ${{ secrets.NETCUP_URI }} | ||
username: ${{ secrets.NETCUP_USER }} | ||
password: ${{ secrets.NETCUP_PASSWORD }} | ||
local-dir: ./docs-site/dist/ | ||
server-dir: / | ||
exclude: | | ||
**/.git* | ||
**/.git*/** | ||
**/node_modules/** | ||
**/.DS_Store | ||
**/Thumbs.db | ||
- name: Skip deployment (secrets not configured) | ||
if: ${{ !secrets.NETCUP_URI || !secrets.NETCUP_USER || !secrets.NETCUP_PASSWORD }} | ||
run: echo "Skipping deployment - Netcup secrets not configured" | ||
- name: Purge Cloudflare cache (optional) | ||
if: ${{ secrets.CLOUDFLARE_ZONE_ID }} | ||
uses: jakejarvis/cloudflare-purge-action@master | ||
env: | ||
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE_ID }} | ||
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} |