~zainab/blog

blog/.build.yml -rw-r--r-- 1.4 KiB
d9e5070ezainab-ali Add question aside 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
image: nixos/21.11
repositories:
  nixpkgs: https://channels.nixos.org/nixos-21.11
packages:
  - nixpkgs.racket
secrets:
  - 8d9a656b-a088-4636-98ce-63c88d6f3d76
tasks:
  - build-site: |
      # Exit - comment this out if you need to ssh onto the node and debug the build
      # exit 1
      ## Content preparation ##
      #########################
      cd blog
      # Install python with pygments
      nix-env -if nix/python.nix
      # Compile scala code with mdoc
      nix-shell --run './nix/mdoc.bash'
      # Build nix derivation
      blogdir=$(nix-build)
      cd ..
      ## Render              ##
      #########################
      cp -r $blogdir site
      chmod -R u+w site # Change the ownership so that pollen can write to this directory
      # Build pollen
      raco pkg install --deps search-auto pollen
      # Render the pages
      raco pollen render site
      ls -hal site
      # Publish the artifacts to a clean directory
      raco pollen publish site target
      ls -halR target
      ## Upload              ##
      #########################
      # Copy the artifacts to the server
      eval `ssh-agent -s`
      ssh-add ~/.ssh/8d9a656b-a088-4636-98ce-63c88d6f3d76
      chmod -R u+w target # The files must be writeable for scp to override them on the next build
      scp -r -o stricthostkeychecking=no target/* shawarma@178.79.173.103:/data/www