|
| 1 | +# Sample workflow for building and deploying a Jekyll site to GitHub Pages |
| 2 | + |
| 3 | +# Copied from https://github.com/libsigcplusplus/libsigcplusplus/actions/new |
| 4 | +# and changed. Actions -> New workflow -> Pages -> GitHub Pages Jekyll |
| 5 | + |
| 6 | +name: Deploy Jekyll with GitHub Pages dependencies preinstalled |
| 7 | + |
| 8 | +# 2022-12-17: ubuntu-latest = ubuntu-22.04 |
| 9 | +on: |
| 10 | + # Runs on pushes targeting the default branch |
| 11 | + push: |
| 12 | + branches: ["master"] |
| 13 | + |
| 14 | + # Allows you to run this workflow manually from the Actions tab |
| 15 | + workflow_dispatch: |
| 16 | + |
| 17 | +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 18 | +permissions: |
| 19 | + contents: read |
| 20 | + pages: write |
| 21 | + id-token: write |
| 22 | + |
| 23 | +# Allow one concurrent deployment |
| 24 | +concurrency: |
| 25 | + group: "pages" |
| 26 | + cancel-in-progress: true |
| 27 | + |
| 28 | +jobs: |
| 29 | + # Build job |
| 30 | + build: |
| 31 | + runs-on: ubuntu-latest |
| 32 | + steps: |
| 33 | + - name: Checkout |
| 34 | + uses: actions/checkout@v3 |
| 35 | + - name: Build |
| 36 | + run: | |
| 37 | + # Prevent blocking apt install on a question during configuring of tzdata. |
| 38 | + export ENV DEBIAN_FRONTEND=noninteractive |
| 39 | + sudo apt update |
| 40 | + sudo apt install libxml2-utils docbook5-xml docbook-xsl mm-common g++ meson ninja-build python3-setuptools python3-pip --yes |
| 41 | + meson -Dbuild-documentation=true -Dbuild-examples=false -Dbuild-tests=false _build |
| 42 | + meson compile -C _build |
| 43 | + - name: Collect Documentation |
| 44 | + # Collect all documentation to be published. |
| 45 | + run: | |
| 46 | + mkdir _publish _publish/_layouts _publish/pix _publish/manual _publish/reference |
| 47 | + # Copy files from the git repository. |
| 48 | + cp docs/_config.yml docs/*.md docs/style.css _publish |
| 49 | + cp docs/_layouts/*.html _publish/_layouts |
| 50 | + cp docs/pix/logo.gif _publish/pix |
| 51 | + # Move generated documentation. |
| 52 | + mv _build/docs/docs/manual/html _publish/manual |
| 53 | + mv _build/docs/docs/reference/html _publish/reference |
| 54 | + - name: Setup Pages |
| 55 | + uses: actions/configure-pages@v2 |
| 56 | + - name: Build with Jekyll |
| 57 | + uses: actions/jekyll-build-pages@v1 |
| 58 | + with: |
| 59 | + source: ./_publish |
| 60 | + destination: ./_site |
| 61 | + - name: Upload artifact |
| 62 | + uses: actions/upload-pages-artifact@v1 |
| 63 | + |
| 64 | + # Deployment job |
| 65 | + # Publish documentation at https://libsigcplusplus.github.io/libsigcplusplus/ |
| 66 | + deploy: |
| 67 | + environment: |
| 68 | + name: github-pages |
| 69 | + url: ${{ steps.deployment.outputs.page_url }} |
| 70 | + runs-on: ubuntu-latest |
| 71 | + needs: build |
| 72 | + steps: |
| 73 | + - name: Deploy to GitHub Pages |
| 74 | + id: deployment |
| 75 | + uses: actions/deploy-pages@v1 |
| 76 | + |
0 commit comments