mirror of
https://github.com/ryan4yin/nixos-and-flakes-book.git
synced 2024-12-01 04:24:01 +01:00
38 lines
1021 B
YAML
38 lines
1021 B
YAML
|
name: "Release PDF"
|
||
|
on:
|
||
|
push:
|
||
|
tags:
|
||
|
- "v*.*.*"
|
||
|
|
||
|
jobs:
|
||
|
generate-pdf:
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
- name: Checkout repository
|
||
|
uses: actions/checkout@v4
|
||
|
- name: Install nix
|
||
|
uses: cachix/install-nix-action@v23
|
||
|
with:
|
||
|
nix_path: "nixpkgs=channel:nixpkgs-unstable"
|
||
|
extra_nix_config: |
|
||
|
experimental-features = nix-command flakes
|
||
|
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||
|
- name: Show nixpkgs version
|
||
|
run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
|
||
|
- name: Run a command with nix develop
|
||
|
run: |
|
||
|
nix develop --ignore-environment --command bash -c '
|
||
|
pnpm install
|
||
|
pnpm export-pdf
|
||
|
'
|
||
|
# - uses: actions/upload-artifact@v3
|
||
|
# with:
|
||
|
# name: pdf
|
||
|
# path: '*.pdf'
|
||
|
- name: Release PDF
|
||
|
uses: softprops/action-gh-release@v1
|
||
|
if: startsWith(github.ref, 'refs/tags/')
|
||
|
with:
|
||
|
files: |
|
||
|
nixos-and-flakes-book.pdf
|