Skip to content

ci: use cache-nix-action #44

ci: use cache-nix-action

ci: use cache-nix-action #44

Workflow file for this run

name: Publish modpack
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: "write"
contents: "read"
steps:
- uses: actions/checkout@v4
- uses: nixbuild/nix-quick-install-action@v29
- name: Restore and cache Nix store
uses: nix-community/cache-nix-action@v5
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
gc-max-store-size: 1073741824
purge: true
purge-prefixes: cache-${{ runner.os }}-
purge-created: 0
purge-primary-key: never
- name: Verify that mods.json is up to date
env:
CFCORE_API_TOKEN: ${{ secrets.CFCORE_API_TOKEN }}
run: |
nix run .#lockMods
git diff --exit-code
- name: Run `nix build`
run: nix build -L --show-trace .
- name: Upload static files as artifact
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: result/
deploy:
if: ${{ github.ref == 'refs/heads/trunk' }}
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4