From 530391b83ee5883dfcc34ce8b4df476bd6516bf3 Mon Sep 17 00:00:00 2001 From: Sam Lehman Date: Mon, 17 Jun 2024 10:38:20 -0400 Subject: [PATCH] github-actions: update workflows --- .github/workflows/build.yml | 19 +++++++++++++++++-- .github/workflows/checks.yml | 33 +++++++++++++++------------------ 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 376cd74..2b881de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,8 +24,19 @@ jobs: needs: checks runs-on: ubuntu-latest steps: - - name: Build flake outputs + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@main + with: + diagnostic-endpoint: "" + - uses: DeterminateSystems/magix-nix-cache-action + diagnostic-endpoint: "" + upstream-cache: https://lehmanator.cachix.org + use-flakehub: false + use-gha-cache: true + - name: Build flake packages.default run: nix build + - name: Build PDF + run: 'nix run .#pdf -- resume.pdf' deploy: needs: build runs-on: ubuntu-latest @@ -35,10 +46,14 @@ jobs: steps: - name: Setup Pages uses: actions/configure-pages@v4 - - name: Upload resume artifacts + - name: Upload resume HTML artifact uses: actions/upload-pages-artifact@v3 with: path: "./result" + - name: Upload resume PDF artifact + uses: actions/upload-pages-artifact@v3 + with: + path: "./resume.pdf" - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 22a5224..80ef5af 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -1,3 +1,4 @@ +--- name: Check flake outputs on: pull_request: @@ -7,30 +8,26 @@ jobs: checks: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - #- name: Install Nix - # uses: cachix/install-nix-action@v22 - # with: - # nix_path: nixpkgs=channel:nixos-unstable - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@main + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@main with: - # Disable telemetry diagnostic-endpoint: "" - - name: Use binary cache - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main with: - # Disable telemetry diagnostic-endpoint: "" - # Use my binary cache (uses cache.nixos.org upstream) upstream-cache: https://lehmanator.cachix.org use-flakehub: false use-gha-cache: true - - name: Check flake inputs - uses: DeterminateSystems/flake-checker-action@main + - uses: DeterminateSystems/flake-checker-action@main with: - # Disable telemetry send-statistics: false - #- name: Check flake - # run: nix flake check + + # Check formatting + - name: Check nix file formatting + run: 'nix fmt . -- --check' + - name: Check yaml file formatting + run: 'nix run nixpkgs#yamllint -- --strict --format github .github/' + - name: Check deadnix file formatting + run: 'nix run nixpkgs#deadnix -- --fail .' + - name: Check flake + run: nix flake check