feat: build and deploy with netlify
Some checks failed
Build and deploy / lint (push) Failing after 1m4s

This commit is contained in:
Iain Learmonth 2025-06-03 16:48:47 +01:00
parent 20d45dca90
commit dc6475b682
5 changed files with 128 additions and 1 deletions

View file

@ -0,0 +1,29 @@
name: Build and deploy
on:
push:
branches:
- main
jobs:
lint:
runs-on: docker
container:
image: ghcr.io/catthehacker/ubuntu:runner-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Nix
uses: https://guardianproject.dev/actions/install-nix-action@v31
- name: Install npm dependencies
run: nix develop --command npm install
- name: Run build
run: nix develop --command npm run build
- name: Deploy
run: nix develop --command netlify deploy --auth ${{ secrets.NETLIFY_AUTH_TOKEN }}

2
.gitignore vendored
View file

@ -24,3 +24,5 @@ yarn-error.log*
# Generated docs
/docs/api
# Local Netlify folder
.netlify

61
flake.lock generated Normal file
View file

@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1748693115,
"narHash": "sha256-StSrWhklmDuXT93yc3GrTlb0cKSS0agTAxMGjLKAsY8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "910796cabe436259a29a72e8d3f5e180fc6dfacc",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View file

@ -0,0 +1,31 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
};
in
with pkgs;
{
devShells.default = mkShell {
buildInputs = [
git
netlify-cli
nodejs_22
];
};
}
);
}

4
netlify.toml Normal file
View file

@ -0,0 +1,4 @@
[build]
command = "npm run build"
functions = "netlify/functions"
publish = "build"