-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
159 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Workflow to build and push the static hugo files to Cachix | ||
name: 🛫 Build and push to Cachix | ||
|
||
on: | ||
# Runs on pushes targeting the default branch | ||
push: | ||
branches: ["main"] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: cachix/install-nix-action@v25 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-unstable | ||
- uses: cachix/cachix-action@v14 | ||
with: | ||
name: qgis-org | ||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | ||
- run: nix build .#qgis-website | ||
- run: nix flake check |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Update Nix Flake inputs | ||
|
||
on: | ||
schedule: | ||
- cron: '0 1 * * *' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
name: Update flakes and commit changes | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# Give the default GITHUB_TOKEN write permission to commit and push the | ||
# added or changed files to the repository. | ||
contents: write | ||
|
||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
# This will allow us to trigger other workflows (cachix-build, etc.) | ||
# when we commit changes using the git-auto-commit-action | ||
token: ${{ secrets.PAT }} | ||
|
||
- name: Install Nix | ||
uses: cachix/install-nix-action@v25 | ||
|
||
- name: Run nix flake update | ||
run: > | ||
nix flake update | ||
- name: '✉️ Commit' | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: 'Flakes updated and committed via a GitHub Action.' | ||
|
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
description = "Development environment and build process for a Hugo app with Python requirements"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
}; | ||
|
||
outputs = { self, nixpkgs }: | ||
let | ||
system = "x86_64-linux"; | ||
|
||
# Importing packages from nixpkgs | ||
pkgs = import nixpkgs { | ||
inherit system; | ||
config.allowUnfree = true; # Allow unfree packages like VSCode if needed | ||
}; | ||
|
||
|
||
mkDevShell = pkgs.mkShell { | ||
packages = with pkgs; [ | ||
hugo # Hugo for building the website | ||
vscode # VSCode for development | ||
python312Packages.icalendar # Python packages | ||
python312Packages.requests # Python packages | ||
gnumake # GNU Make for build automation | ||
]; | ||
|
||
shellHook = '' | ||
export DIRENV_LOG_FORMAT= | ||
echo "-----------------------" | ||
echo "🌈 Your Hugo Dev Environment is ready." | ||
echo "It provides hugo and vscode for use with the QGIS Website Project" | ||
echo "" | ||
echo "🪛 VSCode:" | ||
echo "--------------------------------" | ||
echo "Start vscode like this:" | ||
echo "" | ||
echo "./vscode.sh" | ||
echo "" | ||
echo "🪛 Hugo:" | ||
echo "--------------------------------" | ||
echo "Start Hugo like this:" | ||
echo "" | ||
echo "hugo server" | ||
echo "-----------------------" | ||
''; | ||
}; | ||
|
||
in | ||
{ | ||
devShells.x86_64-linux.default = mkDevShell; | ||
|
||
packages = { | ||
x86_64-linux = { | ||
qgis-website = pkgs.callPackage ./package.nix {}; | ||
}; | ||
}; | ||
}; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ lib, stdenv, hugo, gnumake }: | ||
|
||
stdenv.mkDerivation { | ||
name = "qgis-website"; | ||
src = lib.cleanSourceWith { | ||
src = ./.; | ||
filter = ( | ||
path: type: (builtins.all (x: x != baseNameOf path) [ | ||
".git" | ||
".github" | ||
"flake.nix" | ||
"package.nix" | ||
]) | ||
); | ||
}; | ||
buildInputs = [ hugo gnumake ]; | ||
|
||
buildPhase = '' | ||
make deploy | ||
''; | ||
|
||
installPhase = '' | ||
mkdir -p $out | ||
cp -r public_www public_prod $out/ | ||
''; | ||
|
||
meta = with lib; { | ||
description = "A built QGIS website"; | ||
license = licenses.mit; | ||
}; | ||
} | ||
|