colmena/.github/workflows/manual-stable.yml

61 lines
1.8 KiB
YAML
Raw Permalink Normal View History

# This is the workflow file to deploy the user manual for
# the next stable release. For the one that is currently in
# effect, check the release branches (e.g., release-0.2.x).
2022-01-02 22:15:41 +01:00
name: Deploy Stable Manual
on:
push:
branches:
- release-0.5.x
jobs:
deploy:
2022-08-17 04:15:43 +02:00
name: Deploy
runs-on: ubuntu-latest
2022-08-17 04:15:43 +02:00
if: github.repository == 'zhaofengli/colmena'
steps:
- uses: actions/checkout@v3.3.0
2022-08-17 04:15:43 +02:00
- name: Install Nix
2023-10-18 23:41:54 +02:00
uses: DeterminateSystems/nix-installer-action@9b252454a8d70586c4ee7f163bf4bb1e9de3d763 # v2
2022-08-17 04:15:43 +02:00
- name: Enable Binary Cache
uses: cachix/cachix-action@v12
with:
name: colmena
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Check API version
run: echo "api_version=$(nix eval .#colmena.apiVersion | sed 's|\"||g')" >> $GITHUB_ENV
- name: Check latest stable API version
run: echo "latest_stable_api=$(curl -L https://raw.githubusercontent.com/zhaofengli/colmena/main/.github/latest_stable_api)" >> $GITHUB_ENV
# == Manual
- name: Build manual
run: nix build .#manual -L
- name: Deploy manual
uses: JamesIves/github-pages-deploy-action@4.1.6
with:
branch: gh-pages
folder: result
target-folder: '${{ env.api_version }}'
# == Redirect Farm for Latest Stable
# /stable -> /api_version
- name: Build redirect farm
run: nix build .#manual.redirectFarm -L
if: ${{ env.api_version == env.latest_stable_api }}
- name: Deploy redirect farm
uses: JamesIves/github-pages-deploy-action@4.1.6
with:
branch: gh-pages
folder: result-redirectFarm
target-folder: stable
if: ${{ env.api_version == env.latest_stable_api }}