Deployment #963
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-FileCopyrightText: 2023 Shun Sakai | |
| # | |
| # SPDX-License-Identifier: Apache-2.0 OR MIT | |
| name: Deployment | |
| on: | |
| push: | |
| tags: | |
| - "*-v[0-9]+.[0-9]+.[0-9]+" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| id-token: write | |
| pages: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: | | |
| npm ci | |
| npx antora -v | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: 3.3 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install Asciidoctor | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install fonts-lyx libcairo2-dev libffi-dev libgdk-pixbuf2.0-dev libpango1.0-dev libxml2-dev | |
| gem install asciidoctor-epub3 asciidoctor-mathematical asciidoctor-pdf pygments.rb | |
| asciidoctor-pdf -V | |
| asciidoctor-epub3 -V | |
| - name: Setup just | |
| uses: extractions/setup-just@v3 | |
| - name: Build a book | |
| run: just build-book | |
| - name: Minify a book | |
| uses: docker://tdewolff/minify:latest | |
| with: | |
| args: --exclude "build/site/_/**" -o build/ -r build/ | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: build/site | |
| deploy: | |
| name: Deploy | |
| needs: build | |
| runs-on: ubuntu-24.04 | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |