diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml new file mode 100644 index 0000000..7d9c8ac --- /dev/null +++ b/.forgejo/workflows/build.yaml @@ -0,0 +1,25 @@ +name: build configuration +on: + push: + branches: + - master + +jobs: + build: + runs-on: nix + steps: + - uses: actions/checkout@v3 + + - name: Build + run: nix-build + + - name: deploy + run: nix-shell -p awscli2 --run "aws s3 sync ./result/ s3://$BUCKET/ --delete --endpoint-url $URL" + env: + URL: "https://s3.dgnum.eu/" + BUCKET: pub.dgnum.eu + AWS_ACCESS_KEY_ID: ${{ secrets.KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.SECRET_KEY }} + + + diff --git a/default.nix b/default.nix index aedb7d4..72627fd 100644 --- a/default.nix +++ b/default.nix @@ -51,29 +51,29 @@ let ]); in -{ - devShell = pkgs.mkShell { - packages = [ - (pkgs.callPackage "${sources.lon}/nix/packages/lon.nix" { }) - python3 - ]; +pkgs.stdenv.mkDerivation { + name = "dgnum-landing"; + version = "1.0.1"; + src = ./src; + + passthru = { + devShell = pkgs.mkShell { + packages = [ + (pkgs.callPackage "${sources.lon}/nix/packages/lon.nix" { }) + python3 + ]; + }; }; - package = pkgs.stdenv.mkDerivation { - name = "dgnum-landing"; - version = "1.0.1"; - src = ./src; + buildInputs = [ python3 ]; - buildInputs = [ python3 ]; + env.DATA_FILE = pkgs.writers.writeJSON "data.json" { inherit description links; }; - env.DATA_FILE = pkgs.writers.writeJSON "data.json" { inherit description links; }; + configurePhase = '' + export BUILD_DIR=$out + ''; - configurePhase = '' - export BUILD_DIR=$out - ''; - - buildPhase = '' - python3 build.py - ''; - }; + buildPhase = '' + python3 build.py + ''; }