2021-12-05 10:14:12 +01:00
|
|
|
# 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
|
2021-11-19 00:41:02 +01:00
|
|
|
|
|
|
|
on:
|
2021-12-08 08:27:36 +01:00
|
|
|
push:
|
2021-11-19 00:41:02 +01:00
|
|
|
branches:
|
2023-05-15 07:10:46 +02:00
|
|
|
- release-0.5.x
|
2021-11-19 00:41:02 +01:00
|
|
|
jobs:
|
|
|
|
deploy:
|
2022-08-17 04:15:43 +02:00
|
|
|
name: Deploy
|
|
|
|
|
2021-11-19 00:41:02 +01:00
|
|
|
runs-on: ubuntu-latest
|
2022-08-17 04:15:43 +02:00
|
|
|
if: github.repository == 'zhaofengli/colmena'
|
2021-11-19 00:41:02 +01:00
|
|
|
|
|
|
|
steps:
|
2023-01-28 07:44:41 +01:00
|
|
|
- uses: actions/checkout@v3.3.0
|
2022-08-17 04:15:43 +02:00
|
|
|
|
2023-01-28 07:44:41 +01: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
|
|
|
|
2023-01-28 07:44:41 +01:00
|
|
|
- name: Enable Binary Cache
|
|
|
|
uses: cachix/cachix-action@v12
|
2021-11-19 00:41:02 +01:00
|
|
|
with:
|
|
|
|
name: colmena
|
|
|
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
|
|
|
|
|
|
|
- name: Check API version
|
2021-11-19 01:10:48 +01:00
|
|
|
run: echo "api_version=$(nix eval .#colmena.apiVersion | sed 's|\"||g')" >> $GITHUB_ENV
|
2021-11-19 00:41:02 +01:00
|
|
|
|
2021-12-05 10:14:12 +01:00
|
|
|
- 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
|
|
|
|
|
2021-11-19 00:41:02 +01:00
|
|
|
# == Manual
|
|
|
|
- name: Build manual
|
2021-12-05 10:14:12 +01:00
|
|
|
run: nix build .#manual -L
|
2021-11-19 00:41:02 +01:00
|
|
|
|
|
|
|
- name: Deploy manual
|
2021-12-05 10:14:12 +01:00
|
|
|
uses: JamesIves/github-pages-deploy-action@4.1.6
|
2021-11-19 00:41:02 +01:00
|
|
|
with:
|
|
|
|
branch: gh-pages
|
2021-12-05 10:14:12 +01:00
|
|
|
folder: result
|
2021-11-19 00:41:02 +01:00
|
|
|
target-folder: '${{ env.api_version }}'
|
|
|
|
|
|
|
|
# == Redirect Farm for Latest Stable
|
|
|
|
# /stable -> /api_version
|
|
|
|
|
|
|
|
- name: Build redirect farm
|
2021-12-05 10:14:12 +01:00
|
|
|
run: nix build .#manual.redirectFarm -L
|
|
|
|
if: ${{ env.api_version == env.latest_stable_api }}
|
2021-11-19 00:41:02 +01:00
|
|
|
|
|
|
|
- name: Deploy redirect farm
|
2021-12-05 10:14:12 +01:00
|
|
|
uses: JamesIves/github-pages-deploy-action@4.1.6
|
2021-11-19 00:41:02 +01:00
|
|
|
with:
|
|
|
|
branch: gh-pages
|
2021-12-05 10:14:12 +01:00
|
|
|
folder: result-redirectFarm
|
2021-11-19 00:41:02 +01:00
|
|
|
target-folder: stable
|
2021-12-05 10:14:12 +01:00
|
|
|
if: ${{ env.api_version == env.latest_stable_api }}
|