mirror of
https://github.com/plexguide/Huntarr.git
synced 2026-02-05 01:58:47 -06:00
67 lines
1.8 KiB
YAML
67 lines
1.8 KiB
YAML
name: Deploy GitHub Pages
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: "pages"
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Pages
|
|
id: pages
|
|
uses: actions/configure-pages@v4
|
|
|
|
- name: Prepare Docs
|
|
run: |
|
|
mkdir -p docs/assets/{css,img,js,logo}
|
|
|
|
# Copy assets if they exist
|
|
[ -d frontend/static/css ] && cp -r frontend/static/css/* docs/assets/css/ || true
|
|
[ -d frontend/static/js ] && cp -r frontend/static/js/* docs/assets/js/ || true
|
|
[ -d frontend/static/img ] && cp -r frontend/static/img/* docs/assets/img/ || true
|
|
[ -d assets/logo ] && cp -r assets/logo/* docs/assets/logo/ || true
|
|
|
|
# Create .nojekyll file
|
|
touch docs/.nojekyll
|
|
|
|
# Process nested docs if they exist
|
|
if [ -d "docs/docs" ]; then
|
|
find docs/docs -type f -exec cp {} docs/ \;
|
|
for dir in docs/docs/*/; do
|
|
if [ -d "$dir" ]; then
|
|
dirname=$(basename "$dir")
|
|
mkdir -p "docs/$dirname"
|
|
cp -r "$dir"* "docs/$dirname/" || true
|
|
fi
|
|
done
|
|
fi
|
|
|
|
- name: Upload GitHub Pages artifact
|
|
uses: actions/upload-pages-artifact@v1
|
|
with:
|
|
path: docs
|
|
|
|
deploy:
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v1 |