2021-11-19 00:41:02 +01:00
|
|
|
name: Manual (Stable)
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-11-19 00:47:21 +01:00
|
|
|
- "release-0.2.x"
|
2021-11-19 00:41:02 +01:00
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
env:
|
|
|
|
LATEST_STABLE_API: 0.2
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2.3.5
|
|
|
|
- uses: cachix/install-nix-action@v15
|
|
|
|
with:
|
|
|
|
install_url: https://releases.nixos.org/nix/nix-2.4/install
|
|
|
|
extra_nix_config: |
|
|
|
|
experimental-features = nix-command flakes
|
|
|
|
- uses: cachix/cachix-action@v10
|
|
|
|
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
|
|
|
|
|
|
|
# == Manual
|
|
|
|
- name: Build manual
|
|
|
|
run: nix build -o out .#manual -L
|
|
|
|
|
|
|
|
# Ugly hack so it has permission to delete the worktree afterwards
|
|
|
|
- name: Copy manual
|
|
|
|
run: cp --no-preserve=mode -r out/ public/
|
|
|
|
|
|
|
|
- name: Deploy manual
|
|
|
|
uses: JamesIves/github-pages-deploy-action@4.1.5
|
|
|
|
with:
|
|
|
|
branch: gh-pages
|
|
|
|
folder: public
|
|
|
|
target-folder: '${{ env.api_version }}'
|
|
|
|
|
|
|
|
# == Redirect Farm for Latest Stable
|
|
|
|
# /stable -> /api_version
|
|
|
|
|
|
|
|
- name: Build redirect farm
|
|
|
|
run: nix build -o out .#manual.redirectFarm -L
|
|
|
|
if: ${{ env.api_version == env.LATEST_STABLE_API }}
|
|
|
|
|
|
|
|
# Ugly hack so it has permission to delete the worktree afterwards
|
|
|
|
- name: Copy redirect farm
|
|
|
|
run: cp --no-preserve=mode -r out-redirectFarm/ redirect-farm/
|
|
|
|
if: ${{ success() }}
|
|
|
|
|
|
|
|
- name: Deploy redirect farm
|
|
|
|
uses: JamesIves/github-pages-deploy-action@4.1.5
|
|
|
|
with:
|
|
|
|
branch: gh-pages
|
|
|
|
folder: redirect-farm
|
|
|
|
target-folder: stable
|
|
|
|
if: ${{ success() }}
|