From 063aa7e54ac7a12566668cd50624f9b68e3985e1 Mon Sep 17 00:00:00 2001 From: Fernando Raya Date: Fri, 10 May 2024 17:34:44 +0200 Subject: [PATCH] CD: Build website documentation and deploy to GH pages (#152) * doc: Add creation of website destination directory If the destination directory does not exists, the script finish with an error after showing several lines of output. To avoid the user to ask what has happened, include a paragraph in the documentation to create the destination directory. * git: Update .gitignore Add documentation building directories * ci: Add dependabot * ci: Add build and deploy documentation Execute the 'update.sh' script to generate the documentation. Deploy the documents to GH pages. --- .github/dependabot.yml | 11 ++++ .../workflows/docs-build-linkcheck-deploy.yml | 50 +++++++++++++++++++ .gitignore | 27 +++++++++- README.rst | 5 ++ 4 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/docs-build-linkcheck-deploy.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..0d08e261a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/docs-build-linkcheck-deploy.yml b/.github/workflows/docs-build-linkcheck-deploy.yml new file mode 100644 index 000000000..d6cd03a0d --- /dev/null +++ b/.github/workflows/docs-build-linkcheck-deploy.yml @@ -0,0 +1,50 @@ +name: Build and deploy docs + +on: + push: + # all branches + + # This enables the Run Workflow button on the Actions tab. + workflow_dispatch: + +# https://github.com/JamesIves/github-pages-deploy-action#readme +permissions: + contents: write + +jobs: + + build-and-deploy: + runs-on: ubuntu-latest + steps: + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Install Python package dependencies + uses: BSFishy/pip-action@v1 + with: + packages: | + Sphinx + furo + + - name: Build destination directory + run: mkdir opendylan.org + + - name: Install Opendylan + uses: dylan-lang/install-opendylan@v3 + + - name: Execute update script + run: ./update.sh opendylan.org + + - name: Bypassing Jekyll on GH Pages + run: sudo touch opendylan.org/.nojekyll + + - name: Deploy documents to GH pages + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: opendylan.org diff --git a/.gitignore b/.gitignore index 3b3d49146..39bbbd8dd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,26 @@ -build +# backup files +*~ +*.bak +.DS_Store \#* -*~ \ No newline at end of file + +# project file +*.hdp + +# documentation build directory +build/ + +# compiler build directory +_build/ + +# dylan tool package cache +_packages/ + +# package registry folder +/registry/ + +# packages downloaded +gendoc-scratch-dir/ + +# docs for each package +source/package/ \ No newline at end of file diff --git a/README.rst b/README.rst index f46e388de..9ed64c7db 100644 --- a/README.rst +++ b/README.rst @@ -27,6 +27,11 @@ The next step is fetching the repository and its dependencies:: Building the site ================= +First create the destination directory, for instance +:file:`/tmp/opendylan.org`:: + + mkdir /tmp/opendylan.org + Simply run the :file:`update.sh` script, specifying where you want the HTML files to be generated::