feat: update workflow
This commit is contained in:
parent
beef83e02e
commit
e38719c292
2
.github/workflows/lint.yaml
vendored
2
.github/workflows/lint.yaml
vendored
@ -28,7 +28,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Install NPM Packages
|
- name: Install NPM Packages
|
||||||
working-directory: ./client
|
working-directory: ./client
|
||||||
run: npm ci --legacy-peer-deps
|
run: npm ci
|
||||||
|
|
||||||
- uses: nicknovitski/nix-develop@v1
|
- uses: nicknovitski/nix-develop@v1
|
||||||
|
|
||||||
|
38
.github/workflows/update.yaml
vendored
Normal file
38
.github/workflows/update.yaml
vendored
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
name: Update Workflow
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 * * *"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Nix
|
||||||
|
uses: cachix/install-nix-action@v31
|
||||||
|
with:
|
||||||
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
|
|
||||||
|
- name: Use Cachix
|
||||||
|
uses: cachix/cachix-action@v16
|
||||||
|
with:
|
||||||
|
name: trevstack
|
||||||
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
||||||
|
|
||||||
|
- name: Install NPM Packages
|
||||||
|
working-directory: ./client
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Update
|
||||||
|
run: nix develop --command trevstack-update
|
||||||
|
|
||||||
|
- name: Create Pull Request
|
||||||
|
uses: peter-evans/create-pull-request@v7
|
||||||
|
with:
|
||||||
|
delete-branch: true
|
||||||
|
title: Bump deps
|
||||||
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
git_root=$(git rev-parse --show-toplevel)
|
git_root=$(git rev-parse --show-toplevel)
|
||||||
|
updated=false
|
||||||
|
|
||||||
echo "updating client"
|
echo "updating client"
|
||||||
cd "${git_root}/client"
|
cd "${git_root}/client"
|
||||||
@ -9,6 +10,7 @@ if ! git diff --exit-code package.json package-lock.json; then
|
|||||||
git add package-lock.json
|
git add package-lock.json
|
||||||
git add package.json
|
git add package.json
|
||||||
git commit -m "build(client): updated npm dependencies"
|
git commit -m "build(client): updated npm dependencies"
|
||||||
|
updated=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "updating server"
|
echo "updating server"
|
||||||
@ -19,12 +21,15 @@ if ! git diff --exit-code go.mod go.sum; then
|
|||||||
git add go.mod
|
git add go.mod
|
||||||
git add go.sum
|
git add go.sum
|
||||||
git commit -m "build(go): updated go dependencies"
|
git commit -m "build(go): updated go dependencies"
|
||||||
|
updated=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "updating nix"
|
if [ "${updated}" = true ]; then
|
||||||
cd "${git_root}"
|
echo "updating nix"
|
||||||
nix-update --flake --version=skip --subpackage trevstack-client trevstack
|
cd "${git_root}"
|
||||||
if ! git diff --exit-code flake.nix; then
|
nix-update --flake --version=skip --subpackage trevstack-client trevstack
|
||||||
git add flake.nix
|
git add flake.nix
|
||||||
git commit -m "build(nix): updated nix hashes"
|
git commit -m "build(nix): updated nix hashes"
|
||||||
|
else
|
||||||
|
echo "nothing to update"
|
||||||
fi
|
fi
|
@ -92,9 +92,8 @@
|
|||||||
pname = "${pname}-client";
|
pname = "${pname}-client";
|
||||||
inherit version;
|
inherit version;
|
||||||
src = ./client;
|
src = ./client;
|
||||||
npmDepsHash = "sha256-yKabRCijP2oSe6AhMVvxbY/gCA+7/6xSw0YoIzaGezA=";
|
npmDepsHash = "sha256-o+ANqVBYztpQNAFTThSHdS+euteIGijUTZSXp2DlkDU=";
|
||||||
nodejs = pkgs.nodejs_22;
|
nodejs = pkgs.nodejs_22;
|
||||||
npmFlags = ["--legacy-peer-deps"];
|
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
cp -r build "$out"
|
cp -r build "$out"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user