Skip to content

Commit

Permalink
add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
viperML committed Jun 12, 2024
1 parent 4b7df78 commit 7ea4800
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 11 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Deploy

concurrency: deploy

on:
push:
branches:
- astro

env:
BUILDDIR: ./public

jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main

- name: Install Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@main

- name: Checkout
uses: actions/checkout@main

- name: Build
run: |
nix build -L
cp -vrL ./result/lib/node_modules/neohome/dist ${{ env.BUILDDIR }}
- name: Publish
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
command: pages deploy --project-name=neohome --env astro --branch astro ${{ env.BUILDDIR }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/.direnv
*result*
/public

# build output
dist/
Expand Down
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};

outputs = {
self,
nixpkgs,
}: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
inherit (nixpkgs) lib;
fs = lib.fileset;
r = ./.;
src = fs.toSource {
root = r;
fileset =
fs.intersection
(fs.fromSource (lib.sources.cleanSource r))
(fs.unions [
./src
(fs.fileFilter (file: file.hasExt "ts") r)
(fs.fileFilter (file: file.hasExt "json") r)
]);
};
in {
packages.${system} = {
# deps = with pkgs;
# stdenvNoCC.mkDerivation {
# name = "neohome-deps";
# inherit src;
# nativeBuildInputs = [prefetch-npm-deps];
# buildPhase = ''
# prefetch-npm-deps ./package-lock.json > $out
# '';
# outputHashAlgo = "sha256";
# outputHashMode = "recursive";
# outputHash = "sha256-4SePc3yGlBTGCoCeZtVL9A1NK5vv2CM8EnoRCinhPA0=";
# };

default = with pkgs;
buildNpmPackage {
name = "neohome";
inherit src;
npmDepsHash = "sha256-MXBEcrU3NZw24Ag7qPd4iY69EpSmkI+EU2y+vQehSEY=";
env.ASTRO_TELEMETRY_DISABLED = true;
};
};
};
}
Binary file removed public/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ mkShell {
nodejs

tailwindcss
nodePackages.wrangler
];
}
11 changes: 0 additions & 11 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
---
import Base from "../layouts/Base.astro"
import { Debug } from "astro:components";
import { getCollection, getEntry } from "astro:content";
const allBlogPosts = await getCollection('blog');
const post1 = allBlogPosts[0];
const { Content } = await post1?.render();
---

<Base>
Expand Down
2 changes: 2 additions & 0 deletions wrangler.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[env.astro]
workers_dev = true

0 comments on commit 7ea4800

Please sign in to comment.