refactor: update GitHub Actions workflow for documentation build and deployment

This commit is contained in:
Даниил Грабарь
2026-06-18 06:37:53 +03:00
parent 4a2e23ffef
commit 985425b866
3 changed files with 31 additions and 54 deletions
+28 -13
View File
@@ -6,19 +6,23 @@ on:
- master - master
permissions: permissions:
contents: write contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs: jobs:
deploy-docs: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Python 3.12 - name: Setup Python 3.12
uses: actions/setup-python@v5 uses: actions/setup-python@v6
with: with:
python-version: '3.12' python-version: '3.12'
@@ -33,11 +37,22 @@ jobs:
- name: Install MkDocs - name: Install MkDocs
run: pip install mkdocs-material mkdocs-with-pdf run: pip install mkdocs-material mkdocs-with-pdf
- name: Configure Git - name: Build Documentation
run: | run: mkdocs build
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Deploy to GitHub Pages
run: mkdocs gh-deploy --force
working-directory: doc/lwc-doc working-directory: doc/lwc-doc
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: doc/lwc-doc/site/
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to Pages
id: deployment
uses: actions/deploy-pages@v4
-40
View File
@@ -1,40 +0,0 @@
name: Документация
on:
push:
branches:
- master
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install system dependencies (WeasyPrint/PDF)
run: |
sudo apt-get update -qq
sudo apt-get install -y \
libcairo2 libpango-1.0-0 libpangoft2-1.0-0 \
libgdk-pixbuf-2.0-0 libffi-dev \
fontconfig fonts-dejavu
- name: Install MkDocs
run: pip install mkdocs-material mkdocs-with-pdf
- name: Build Documentation
run: mkdocs build
working-directory: doc/lwc-doc
- name: Upload site as artifact
uses: actions/upload-artifact@v4
with:
name: documentation-site
path: doc/lwc-doc/site/
retention-days: 30
+3 -1
View File
@@ -1,4 +1,6 @@
# Welcome to MkDocs выq # Welcome to MkDocs
Тест, того что все работает, и что документация собирается.
For full documentation visit [mkdocs.org](https://www.mkdocs.org). For full documentation visit [mkdocs.org](https://www.mkdocs.org).