-
-
Notifications
You must be signed in to change notification settings - Fork 11
47 lines (45 loc) · 1.57 KB
/
build_and_release.yml
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
name: Build and Release
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
- push
- pull_request
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
name: Build all files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Run tests
run: nix flake check -L
publish:
name: Publish
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
if: startsWith(github.ref, 'refs/tags/')
steps:
# only execute if a new release is created
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix build .#documentation-artifacts
- uses: actions/checkout@v4
with:
repository: kai-tub/latex-beamer-pure-minimalistic.wiki.git
path: wiki
- run: |
echo "Copy documentation results to wiki"
install --mode=666 ./result wiki/
cd wiki
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "update wiki"
echo "annotate release if release triggered the workflow"
git tag --annotate --message "Release" ${{ github.ref_name }}
git push