-
-
Notifications
You must be signed in to change notification settings - Fork 8
51 lines (49 loc) · 1.39 KB
/
gendocs.yaml
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
42
43
44
45
46
47
48
49
50
51
name: Gen Docs
on:
push:
branches: [ main, develop ]
tags: v*
paths:
- '**.nim*'
- '**.cfg'
- '.github/workflows/**'
jobs:
generate-docs:
runs-on: ubuntu-latest
steps:
- name: Fetch repo's pushed branch
uses: actions/checkout@v3
with:
ref: ${{ github.ref_name }}
path: source
- name: Fetch repos's docs branch
uses: actions/checkout@v3
with:
ref: docs
path: destination
- name: Install nix
uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-22.05
- name: Setup cachix
uses: cachix/cachix-action@v12
with:
name: my-dotfiles # Holds the cached flake, so not to build it
- name: Build docs
run: |
cd source
nix shell -c nimble install pixie -y
nix shell -c nimble gendocs ${{ github.ref_name }}
cd ..
- name: Move docs to destination
run: |
nix shell nixpkgs#rsync -c \
rsync -a --force source/docs/ destination/${{ github.ref_name }}
- name: Push docs
run: |
cd destination
git config user.name github-actions
git config user.email [email protected]
git add -A
git commit -m "[workflow] Generated ${{ github.ref_name }} docs"
git push