From e9d3f067c13bdefed58836db7f698a1a0a41d080 Mon Sep 17 00:00:00 2001 From: Robert Di Pardo Date: Sat, 6 Apr 2024 16:56:18 -0400 Subject: [PATCH] Use Actions to publish docs --- .gitattributes | 2 +- .github/workflows/fpdocs.yml | 35 +++++++++++++++++++++++++++++++++++ README.rst | 2 +- docs/build | 3 ++- 4 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/fpdocs.yml diff --git a/.gitattributes b/.gitattributes index 6337513b2..ce4aba93c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ * text eol=lf -*.inc linguist-language=Pascal +*.inc linguist-generated *.png binary *.ico binary diff --git a/.github/workflows/fpdocs.yml b/.github/workflows/fpdocs.yml new file mode 100644 index 000000000..bd88a88bc --- /dev/null +++ b/.github/workflows/fpdocs.yml @@ -0,0 +1,35 @@ +# Source: https://github.com/actions/starter-workflows/blob/main/pages/static.yml +# +# SPDX-FileCopyrightText: (c) 2020 GitHub +# SPDX-License-Identifier: MIT +# +name: Publish Docs + +on: + push: + branches: + - api + +permissions: + contents: read + pages: write + id-token: write + +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: '.' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/README.rst b/README.rst index 0907085a4..312d6d2fc 100644 --- a/README.rst +++ b/README.rst @@ -63,5 +63,5 @@ Requirements :alt: CircleCI :target: https://circleci.com/gh/rdipardo/fpgeanyplugin -.. |fpc| image:: https://img.shields.io/github/languages/top/rdipardo/fpgeanyplugin?style=flat-square&color=lightblue&label=Free%20Pascal&logo=lazarus +.. |fpc| image:: https://img.shields.io/github/license/rdipardo/fpgeanyplugin?style=flat-square&color=lightblue&label=Free%20Pascal&logo=lazarus :alt: Built with Free Pascal diff --git a/docs/build b/docs/build index d5696be45..d44b1a752 100755 --- a/docs/build +++ b/docs/build @@ -39,7 +39,8 @@ for pkg in 'lcl' 'fpgeanyplugin'; do done find ./html -maxdepth 1 -type f -iname \*.html -exec sed -i '/\[\]/d' {} + find ./html -type f -iname fpdoc.css -exec dirname {} \; -exec cp ./fpdoc.css {} \; -touch ./html/.nojekyll && cp favicon.ico ./html 2>/dev/null +cp favicon.ico ./html 2>/dev/null [ -d './html/.git' ] && \ + cp -r ../.github/ ./html && \ [ "$(git --git-dir=./html/.git --work-tree=./html/ status -s | grep -cE "[ADM(\?\?)]")" -ne 0 ] && \ cd ./html && git add . && git commit