/ .github / workflows / build.yml
build.yml
 1  name: Build CV
 2  
 3  on:
 4    push:
 5      branches: [main]
 6      tags: ["v*"]
 7    pull_request:
 8      branches: [main]
 9  
10  jobs:
11    build:
12      runs-on: ubuntu-latest
13      steps:
14        - uses: actions/checkout@v4
15  
16        - uses: DeterminateSystems/nix-installer-action@main
17        - uses: DeterminateSystems/magic-nix-cache-action@main
18  
19        - name: Build CV
20          run: nix build .#cv
21  
22        - name: Upload artifact
23          uses: actions/upload-artifact@v4
24          with:
25            name: cv
26            path: result/cv.pdf
27  
28    release:
29      needs: build
30      if: startsWith(github.ref, 'refs/tags/v')
31      runs-on: ubuntu-latest
32      permissions:
33        contents: write
34      steps:
35        - uses: actions/checkout@v4
36  
37        - uses: DeterminateSystems/nix-installer-action@main
38        - uses: DeterminateSystems/magic-nix-cache-action@main
39  
40        - name: Build CV
41          run: nix build .#cv
42  
43        - name: Create Release
44          uses: softprops/action-gh-release@v2
45          with:
46            files: result/cv.pdf
47            generate_release_notes: true