diff --git a/.gitignore b/.gitignore index 7329a85..903bb15 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ dist/ # dependencies node_modules/ +.yarn/install-state.gz # logs npm-debug.log* @@ -18,3 +19,14 @@ pnpm-debug.log* # macOS-specific files .DS_Store + +# Devenv +.devenv* +devenv.local.nix +devenv.local.yaml + +# direnv +.direnv + +# pre-commit +.pre-commit-config.yaml diff --git a/.yarnrc.yml b/.yarnrc.yml index 3186f3f..dc61281 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1 +1,6 @@ +approvedGitRepositories: + - "**" + +enableScripts: true + nodeLinker: node-modules diff --git a/README.md b/README.md index 306af61..7f832ac 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,16 @@ This website is built using [Astro](https://astro.build) +## CI + +For building the image on the server, the command to use is + +```bash +devenv tasks run news:build +``` + +After that, a Caddy image will serve the files generated in the `dist` directory + ## 🧞 Commands All commands are run from the root of the project, from a terminal: @@ -40,7 +50,6 @@ There's nothing special about `src/components/`, but that's where we like to put Any static assets, like images, can be placed in the `public/` directory. - ## 👀 Want to learn more? -Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat). \ No newline at end of file +Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat). diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..03fb10a --- /dev/null +++ b/build.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +if command -v yarn >/dev/null 2>&1; then + echo "yarn is available" +else + echo "yarn is not installed" >&2 + exit 1 +fi + +yarn install + +yarn build \ No newline at end of file diff --git a/devenv.lock b/devenv.lock new file mode 100644 index 0000000..ade115c --- /dev/null +++ b/devenv.lock @@ -0,0 +1,65 @@ +{ + "nodes": { + "devenv": { + "locked": { + "dir": "src/modules", + "lastModified": 1787952362, + "narHash": "sha256-2vxVcc2CO7ihRRqg1OuqsVnOAoQ+kaRu7829hN44xLs=", + "owner": "cachix", + "repo": "devenv", + "rev": "eeced8155ca9d573f5f3e22cbe925e7fbe4e761b", + "type": "github" + }, + "original": { + "dir": "src/modules", + "owner": "cachix", + "repo": "devenv", + "type": "github" + } + }, + "nixpkgs": { + "inputs": { + "nixpkgs-src": "nixpkgs-src" + }, + "locked": { + "lastModified": 1787753358, + "narHash": "sha256-Tl77VbWyAKrOfRNQhL6JbQtb/MLzbYa/1RG1gWWfICk=", + "owner": "cachix", + "repo": "devenv-nixpkgs", + "rev": "256551e45f6303e142ab4a98be1bf243feb77dc0", + "type": "github" + }, + "original": { + "owner": "cachix", + "ref": "rolling", + "repo": "devenv-nixpkgs", + "type": "github" + } + }, + "nixpkgs-src": { + "flake": false, + "locked": { + "lastModified": 1787394516, + "narHash": "sha256-pRGOQSClnXNI2iLUG6DYpsGvYcuw0drOutVZFTJNw90=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c8f90650c15282fa8656a041bfbbd2403997a9a7", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "devenv": "devenv", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} \ No newline at end of file diff --git a/devenv.nix b/devenv.nix new file mode 100644 index 0000000..933670f --- /dev/null +++ b/devenv.nix @@ -0,0 +1,19 @@ +{ pkgs, ... }: { + languages = { + javascript = { + enable = true; + package = pkgs.nodejs_22; + yarn = { + enable = true; + package = pkgs.yarn-berry; + }; + }; + }; + tasks."news:install" = { + exec = ''yarn install''; + before = ["news:build"]; + }; + tasks."news:build" = { + exec = ''yarn build''; + }; +} diff --git a/devenv.yaml b/devenv.yaml new file mode 100644 index 0000000..3dcab58 --- /dev/null +++ b/devenv.yaml @@ -0,0 +1,18 @@ +# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json +inputs: + nixpkgs: + url: github:cachix/devenv-nixpkgs/rolling + +# If you're using non-OSS software, you can set allow_unfree to true. +# allow_unfree: true + +# If you're not willing to allow unsupported packages: +# allow_unsupported_system: false + +# If you're willing to use a package that's vulnerable +# permitted_insecure_packages: +# - "openssl-1.1.1w" + +# If you have more than one devenv you can merge them +#imports: +# - ./backend diff --git a/yarn.lock b/yarn.lock index b97c73d..688c030 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,7 +2,7 @@ # Manual changes might be lost - proceed with caution! __metadata: - version: 8 + version: 9 cacheKey: 10c0 "@ampproject/remapping@npm:^2.2.0":