-
Notifications
You must be signed in to change notification settings - Fork 51
41 lines (35 loc) · 1.21 KB
/
docs.yml
File metadata and controls
41 lines (35 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Deploy docs
on:
push:
branches:
- main
tags:
- "v*"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: cachix/install-nix-action@v31
- name: Configure Git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Deploy main
if: github.ref_name == 'main'
run: |
nix develop ./docs --command bash -c "cd docs && mike deploy -p main"
- name: Deploy version
if: startsWith(github.ref, 'refs/tags/v')
run: |
REF_NAME=${{ github.ref_name }}
MAJOR_MINOR=${REF_NAME%.*}
nix develop ./docs --command bash -c "cd docs && mike deploy -p -u ${MAJOR_MINOR} latest"