Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 26 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,43 @@
name: 'build'
name: build

on:
pull_request:
push:

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- name: 'Checkout codebase'
if: github.event_name == 'push'
uses: actions/checkout@v2.4.0
- name: Checkout (push/merge)
if: ${{ github.event_name != 'pull_request' }}
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: 'Checkout codebase'
if: github.event_name == 'pull_request'
uses: actions/checkout@v2.4.0
- name: Checkout (PR head)
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v5
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- uses: cachix/install-nix-action@v14
- run: NIXPKGS_ALLOW_UNFREE=1 nix --experimental-features 'nix-command flakes' build -L --impure
- name: 'Copy book'
run: cp result/share/book.pdf .
- name: 'Upload artifact to GitHub'
uses: actions/upload-artifact@v2.2.4
- name: Install Nix
uses: cachix/install-nix-action@v31

- name: Build (Nix flake)
run: nix build -L --impure
env:
NIXPKGS_ALLOW_UNFREE: 1

- name: Copy book
run: cp result/share/book.pdf ./book.pdf

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: book.pdf
path: book.pdf
if-no-files-found: error
retention-days: 90
36 changes: 27 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.