tools/corrosion/.github/workflows/gh-pages.yaml
author unC0Rr
Wed, 20 Nov 2024 21:37:47 +0100
branchtransitional_engine
changeset 16067 d903f8d2395a
parent 16050 6a3dc15b78b9
permissions -rw-r--r--
- Update corrosion - Implement installation of targets imported with corrosion
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16050
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
     1
name: Deploy GH pages
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
     2
on:
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
     3
  push:
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
     4
    branches:
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
     5
      - master
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
     6
  # Allows you to run this workflow manually from the Actions tab
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
     7
  workflow_dispatch:
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
     8
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
     9
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    10
permissions:
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    11
  contents: read
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    12
  pages: write
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    13
  id-token: write
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    14
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    15
# Allow one concurrent deployment
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    16
concurrency:
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    17
  group: "pages"
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    18
  cancel-in-progress: true
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    19
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    20
jobs:
16067
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    21
  # Build and deploy the documentation of master and the stable/v0.5 branch
16050
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    22
  deploy:
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    23
    runs-on: ubuntu-latest
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    24
    environment:
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    25
      name: github-pages
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    26
      url: ${{ steps.deployment.outputs.page_url }}
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    27
    steps:
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    28
      - name: Install mdbook
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    29
        env:
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    30
          MDBOOK_VERSION: 'v0.4.27'
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    31
        run: |
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    32
          mkdir mdbook
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    33
          curl -sSL https://github.com/rust-lang/mdBook/releases/download/${MDBOOK_VERSION}/mdbook-${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    34
          echo `pwd`/mdbook >> $GITHUB_PATH
16067
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    35
      - name: Checkout master
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    36
        uses: actions/checkout@v4
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    37
        with:
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    38
          path: main
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    39
      - name: Checkout stable/v0.5
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    40
        uses: actions/checkout@v4
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    41
        with:
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    42
          path: stable-v0.5
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    43
          ref: 'stable/v0.5'
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    44
      - name: Setup Pages
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    45
        uses: actions/configure-pages@v3
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    46
      - name: Build mdbook for main branch
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    47
        working-directory: 'main/doc'
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    48
        run: mdbook build
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    49
      - name: Build mdbook for stable/v0.5 branch
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    50
        working-directory: 'stable-v0.5/doc'
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    51
        run: mdbook build
16050
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    52
      # Override mdbooks default highlight.js with a custom version containing CMake support.
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    53
      - uses: actions/checkout@v4
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    54
        with:
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    55
          repository: 'highlightjs/highlight.js'
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    56
          # mdbook currently (as of v0.4.27) does not support v11 yet.
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    57
          ref: '10.7.3'
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    58
          path: highlightjs
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    59
      - name: Build custom highlight.js
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    60
        run: |
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    61
          npm install
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    62
          node tools/build.js :common cmake yaml
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    63
        working-directory: highlightjs
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    64
      - name: Override highlightjs
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    65
        run: |
16067
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    66
          cp highlightjs/build/highlight.min.js main/doc/book/highlight.js
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    67
          cp highlightjs/build/highlight.min.js stable-v0.5/doc/book/highlight.js
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    68
      - name: Copy stable doc into main
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    69
        run: mkdir main/doc/book/v0.5 && cp -a stable-v0.5/doc/book/. main/doc/book/v0.5/
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    70
      - name: Debug print
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    71
        run: ls -la main/doc/book/v0.5
16050
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    72
      - name: Upload artifact
16067
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    73
        uses: actions/upload-pages-artifact@v2
16050
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    74
        with:
16067
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    75
          path: 'main/doc/book'
16050
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    76
      - name: Deploy to GitHub Pages
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    77
        id: deployment
16067
d903f8d2395a - Update corrosion
unC0Rr
parents: 16050
diff changeset
    78
        uses: actions/deploy-pages@v2