Skip to content

Add Plex server-list troubleshooting to Configuration doc (#94) #41

Add Plex server-list troubleshooting to Configuration doc (#94)

Add Plex server-list troubleshooting to Configuration doc (#94) #41

Workflow file for this run

name: Docusaurus Deploy
on:
push:
branches:
- main
repository_dispatch:
types: [maintainerr-release]
workflow_dispatch:
inputs:
versionInput:
description: "Input version from Maintainerr release"
required: false
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
if: github.event.repository.fork == false
env:
RELEASE_VERSION: ${{ github.event.inputs.versionInput || github.event.client_payload.versionInput }}
DISPATCH_BRANCH: ${{ github.event.client_payload.target_branch }}
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
steps:
- name: Create GitHub App token
id: app-token
uses: actions/create-github-app-token@v3
with:
client-id: ${{ vars.DOCS_APP_CLIENT_ID || secrets.DOCS_APP_CLIENT_ID || secrets.DOCS_APP_ID }}
private-key: ${{ secrets.DOCS_APP_KEY }}
- name: Resolve bot identity
id: bot
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
APP_SLUG: ${{ steps.app-token.outputs.app-slug }}
run: |
user_id=$(gh api "/users/${APP_SLUG}[bot]" --jq .id)
echo "name=${APP_SLUG}[bot]" >> "$GITHUB_OUTPUT"
echo "email=${user_id}+${APP_SLUG}[bot]@users.noreply.github.com" >> "$GITHUB_OUTPUT"
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
# A release dispatch always builds the trusted default branch. We do not
# honor an externally supplied client_payload.ref, which could otherwise
# point the privileged build (App token + npm ci) at arbitrary code.
ref: ${{ github.event_name == 'repository_dispatch' && github.event.repository.default_branch || github.ref }}
token: ${{ steps.app-token.outputs.token }}
- name: Resolve source branch
id: branch
run: |
if [ -n "${DISPATCH_BRANCH}" ]; then
SOURCE_BRANCH="${DISPATCH_BRANCH}"
elif [ "${GITHUB_EVENT_NAME}" = "repository_dispatch" ]; then
SOURCE_BRANCH="${DEFAULT_BRANCH:-main}"
else
SOURCE_BRANCH="${GITHUB_REF_NAME}"
fi
echo "source_branch=${SOURCE_BRANCH}" >> "${GITHUB_OUTPUT}"
- name: Validate version input
if: env.RELEASE_VERSION != ''
run: |
VERSION="${RELEASE_VERSION}"
if [[ ! "${VERSION}" =~ ^[a-zA-Z0-9._-]+$ ]]; then
echo "Invalid version format: '${VERSION}'"
echo "Allowed characters: letters, numbers, dots (.), hyphens (-), and underscores (_)"
exit 1
fi
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm ci
- name: Configure Git credentials
if: env.RELEASE_VERSION != ''
run: |
git config user.name "${{ steps.bot.outputs.name }}"
git config user.email "${{ steps.bot.outputs.email }}"
- name: Create docs version snapshot
if: env.RELEASE_VERSION != ''
run: |
VERSION="${RELEASE_VERSION}"
if [ -f versions.json ] && grep -q "\"${VERSION}\"" versions.json; then
echo "Docs version ${VERSION} already exists"
exit 0
fi
npm run docs:version -- "${VERSION}"
- name: Commit docs version snapshot
if: env.RELEASE_VERSION != ''
env:
SOURCE_BRANCH: ${{ steps.branch.outputs.source_branch }}
run: |
if git diff --quiet -- versions.json versioned_docs versioned_sidebars; then
echo "No versioned docs changes to commit"
exit 0
fi
if [[ ! "${SOURCE_BRANCH}" =~ ^[A-Za-z0-9._/-]+$ ]]; then
echo "Refusing to push to unexpected branch name: '${SOURCE_BRANCH}'"
exit 1
fi
git add versions.json versioned_docs versioned_sidebars
git commit -m "docs: snapshot ${RELEASE_VERSION}"
git push origin "HEAD:refs/heads/${SOURCE_BRANCH}"
- name: Build Docusaurus site
run: npm run build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ steps.app-token.outputs.token }}
publish_dir: ./build
publish_branch: gh-pages
force_orphan: true
user_name: ${{ steps.bot.outputs.name }}
user_email: ${{ steps.bot.outputs.email }}