Skip to content

Bump rollup from 4.34.4 to 4.59.0 in the npm_and_yarn group across 1 directory #98

Bump rollup from 4.34.4 to 4.59.0 in the npm_and_yarn group across 1 directory

Bump rollup from 4.34.4 to 4.59.0 in the npm_and_yarn group across 1 directory #98

Workflow file for this run

name: Docs
on:
push:
branches:
- master
- 'Stable*'
paths:
- 'docs/**'
- 'package*.json'
pull_request:
paths:
- 'docs/**'
- 'package*.json'
workflow_dispatch:
permissions:
contents: read
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 'lts/*'
cache: npm
- name: Install dependencies
run: npm ci
- name: Build with VitePress
run: |
npm run docs:build
touch docs/.vitepress/dist/.nojekyll
- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: qgc_docs_build
path: docs/.vitepress/dist/
retention-days: 1
deploy:
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: build
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit
- name: Download Artifact
uses: actions/download-artifact@v7
with:
name: qgc_docs_build
path: ~/_book
- name: Checkout docs repo
uses: actions/checkout@v6
with:
repository: mavlink/docs.qgroundcontrol.com
token: ${{ secrets.PX4BUILDBOT_ACCESSTOKEN }}
path: docs.qgroundcontrol.com
- name: Deploy docs
env:
BRANCH: ${{ env.BRANCH_NAME }}
run: |
# Sanitize branch name to prevent path traversal and shell injection
SAFE_BRANCH="${BRANCH//[^a-zA-Z0-9._-]/_}"
rm -rf "docs.qgroundcontrol.com/${SAFE_BRANCH}"
mkdir -p "docs.qgroundcontrol.com/${SAFE_BRANCH}"
cp -r ~/_book/* "docs.qgroundcontrol.com/${SAFE_BRANCH}/"
cd docs.qgroundcontrol.com
git config user.email "bot@px4.io"
git config user.name "PX4BuildBot"
git add "${SAFE_BRANCH}"
git commit -m "QGC docs build update $(date -u +%Y-%m-%d)"
git push origin master