Skip to content

Commit

Permalink
Use Nix in GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
gapuchi committed May 29, 2024
1 parent 47906f9 commit e0ee333
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ jobs:

steps:
- name: Set up Git repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Compile LaTeX document
uses: xu-cheng/latex-action@v2
- name: Install Nix
uses: cachix/install-nix-action@v27
with:
root_file: resume.tex

github_access_token: ${{ secrets.GITHUB_TOKEN }}

- name: Build PDF
run: nix build

- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand All @@ -35,6 +38,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./resume.pdf
asset_path: result/resume.pdf
asset_name: resume.pdf
asset_content_type: application/pdf
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Resume

This repo generates my resume. [github-action-for-latex](https://github.com/marketplace/actions/github-action-for-latex) compiles the generated latex file to a PDF. It is then uploaded as an asset to this repo's releases.
This repo generates my resume. My resume is written in Latex, which is then used to generate the final PDF.

I use Nix Flakes to handle my dependencies and packaging. `flake.nix` contains devShell where it has latex dependencies installed and also a packaging that is used to build my PDF via `nix build`. I use the same packaging in my GitHub Actions to generate the PDF and create a release with the PDF uploaded.

Check out the [Releases](https://github.com/gapuchi/resume/releases) for my latest resume.

0 comments on commit e0ee333

Please sign in to comment.