Skip to content

Rabbitfrei

Rabbitfrei #1516

name: Generate docs and push to dedicated repo for publishing
on:
pull_request:
branches: [develop, master]
push:
branches: [develop, master]
tags: [v*]
release:
types: [published]
jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: cachix/install-nix-action@v31.10.1
- uses: cachix/cachix-action@v17
with:
name: lomas
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Install devenv.sh
run: nix profile add nixpkgs/64c08a7ca051951c8eae34e3e3cb1e202fe36786#devenv
- name: Build the doc
run: devenv shell -- build-docs
- name: Set git credentials
run: |
# Prepare all this to allow deploy --push on mike
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git remote set-url origin https://${{ github.token }}@${GITHUB_DOMAIN:-"github.com"}/${GITHUB_REPOSITORY}.git
# sync gh-pages remote
git fetch --all --tags --prune
- name: Publish Develop doc
if: github.event_name == 'push' || github.event_name == 'release' || github.ref_type == 'tag'
run: |
REF="${{ github.ref_name }}"
if [ "${{ github.ref_type }}" = "tag"]; then
MAJMIN=$(echo "${REF#v}" | awk -F. '{print $1"."$2}')
devenv shell -- mike deploy "$MAJMIN" latest --update-aliases --push
else
devenv shell -- mike deploy develop --push
fi