Update haskell dependencies (Nix) #361
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GHCJS (build and deploy Rzk playground) | ||
on: | ||
push: | ||
branches: [main, develop] | ||
tags: [v*] | ||
paths: &paths | ||
- .github/workflows/ghcjs.yml | ||
- rzk/** | ||
- rzk-js/** | ||
- rzk-playground/** | ||
- stack.yaml | ||
- "**/*.nix" | ||
- "flake.lock" | ||
pull_request: | ||
branches: [develop] | ||
paths: *paths | ||
workflow_dispatch: # allow triggering this workflow manually | ||
permissions: | ||
contents: write | ||
jobs: | ||
build-and-deploy-with-ghcjs: | ||
name: "Build with GHCJS (and deploy Rzk playground)" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 📥 Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: ❄️ Install Nix | ||
uses: nixbuild/nix-quick-install-action@v25 | ||
with: | ||
nix_conf: | | ||
substituters = https://cache.nixos.org/ https://cache.iog.io https://nix-community.cachix.org https://miso-haskell.cachix.org https://rzk-lang.cachix.org | ||
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= miso-haskell.cachix.org-1:6N2DooyFlZOHUfJtAx1Q09H0P5XXYzoxxQYiwn6W1e8= rzk-lang.cachix.org-1:hz9Ld3hYNWSM7cswW/28Dt4ABgGdK0CfBDx/MrciZW8= | ||
keep-outputs = true | ||
- name: 👝 Restore and Cache Nix store | ||
uses: nix-community/cache-nix-action@v4 | ||
with: | ||
key: ${{ runner.os }}-nix-${{ hashfiles('flake*', '.github/workflows/ghcjs.yml', '**/*.cabal') }} | ||
restore-keys: | | ||
${{ runner.os }}-nix-${{ hashfiles('flake*', '.github/workflows/ghcjs.yml', '**/*.cabal') }} | ||
${{ runner.os }}-nix- | ||
gc-linux: true | ||
gc-max-store-size-linux: 8000000000 | ||
purge: true | ||
purge-created-max-age: 1209600 | ||
- name: 👝 Restore and Cache NextJS cache | ||
uses: actions/cache@v3 | ||
with: | ||
key: ${{ runner.os }}-next-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-next- | ||
path: | | ||
~/.npm | ||
rzk-playground/.next/cache | ||
- name: 🔨 Remove lexer and parser generator files | ||
run: | | ||
rm -f rzk/src/Language/Rzk/Syntax/Lex.x | ||
rm -f rzk/src/Language/Rzk/Syntax/Par.y | ||
- name: 🔨 Build Playground | ||
env: | ||
ASSET_URL: /${{ github.event.repository.name }}/${{ github.ref_name }}/playground | ||
run: | | ||
nix run .#release-rzk-playground | ||
- name: '🚀 Publish JS "binaries" (${{ github.ref_name }})' | ||
if: ${{ github.ref_name != 'main' && github.event_name == 'push' }} | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
folder: rzk-playground-release | ||
target-folder: ${{ github.ref_name }}/playground | ||
clean: false | ||
single-commit: true | ||
- name: '🚀 Publish JS "binaries"' | ||
if: ${{ github.ref_name == 'main' && github.event_name == 'push' }} | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
folder: rzk-playground-release | ||
target-folder: playground | ||
clean: false | ||
single-commit: true | ||
- name: 🔨 Save flake from garbage collection | ||
run: nix run .#save-flake |