Skip to content

Commit

Permalink
changing the haskell build CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kaychaks committed Nov 5, 2020
1 parent 2920b00 commit 3eacbd5
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 28 deletions.
41 changes: 24 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is a basic workflow to help you get started with Actions

name: New Post
name: Blog Workflow

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
Expand All @@ -22,27 +22,34 @@ jobs:
with:
ref: 'develop'

- name: Nix
uses: cachix/install-nix-action@v11
- name: Setup Haskell
uses: actions/setup-haskell@v1
with:
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/289466dd6a11c65a7de4a954d6ebf66c1ad07652.tar.gz
ghc-version: '8.8.2'
cabal-version: '3.0.0'

- name: Nix config
run: |
mkdir -p $HOME/.config/nixpkgs
mv config.nix $_
- name: Cachix
uses: cachix/cachix-action@master
- name: Cache
uses: actions/cache@v1
env:
cache-name: cache-cabal
with:
# Name of a cachix cache to push and pull/substitute
name: kaushikc
# Signing key secret retrieved after creating binary cache on https://cachix.org
signingKey: ${{ secrets.CACHIX_SIGNING_KEY }}
extraPullNames: 'iohk'
path: ~/.cabal
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: |
cabal update
cabal v2-build
- name: Build
run: nix-build shell.nix -o site
run: |
cabal v2-build
cabal v2-exec site build
- name: Checkout
uses: actions/checkout@v2.3.1
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ _cache
!/.gitignore
!.circleci/
*.out
dist*
dist*
site/
18 changes: 9 additions & 9 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"homepage": "https://input-output-hk.github.io/haskell.nix",
"owner": "input-output-hk",
"repo": "haskell.nix",
"rev": "0bc98977a44905a25c45b656af7f29a57a1f2f95",
"sha256": "1cpf23q1pradq5x0qwsc9rdi7l6v0nnb18yv2rb3m3gh8shjann0",
"rev": "23539aef9ea3591dc0d218c5f60b2a4f7d229a20",
"sha256": "1gzvqac58kn22rh40nad6qvvqp4qli9l526wl8rgj8rx2k7qm7sa",
"type": "tarball",
"url": "https://github.com/input-output-hk/haskell.nix/archive/0bc98977a44905a25c45b656af7f29a57a1f2f95.tar.gz",
"url": "https://github.com/input-output-hk/haskell.nix/archive/23539aef9ea3591dc0d218c5f60b2a4f7d229a20.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"niv": {
Expand All @@ -17,10 +17,10 @@
"homepage": "https://github.com/nmattia/niv",
"owner": "nmattia",
"repo": "niv",
"rev": "febd3530f0c2f2fb74752ee4d9dd2518d302f618",
"sha256": "1gifi50k4h6wk9ix0yvp66p7jk8rrqgr39r5rf4lyha6pbs7dbk6",
"rev": "20c899271f288d33114760bc298838575fc6c7f9",
"sha256": "07zswk6dhlydihl9g6skmy52grjvqpra8r98f2dmbgwzc1yhjhxq",
"type": "tarball",
"url": "https://github.com/nmattia/niv/archive/febd3530f0c2f2fb74752ee4d9dd2518d302f618.tar.gz",
"url": "https://github.com/nmattia/niv/archive/20c899271f288d33114760bc298838575fc6c7f9.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs": {
Expand All @@ -29,10 +29,10 @@
"homepage": "https://github.com/NixOS/nixpkgs",
"owner": "NixOS",
"repo": "nixpkgs-channels",
"rev": "289466dd6a11c65a7de4a954d6ebf66c1ad07652",
"sha256": "0r5ja052s86fr54fm1zlhld3fwawz2w1d1gd6vbvpjrpjfyajibn",
"rev": "75f4ba05c63be3f147bcc2f7bd4ba1f029cedcb1",
"sha256": "157c64220lf825ll4c0cxsdwg7cxqdx4z559fdp7kpz0g6p8fhhr",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs-channels/archive/289466dd6a11c65a7de4a954d6ebf66c1ad07652.tar.gz",
"url": "https://github.com/NixOS/nixpkgs-channels/archive/75f4ba05c63be3f147bcc2f7bd4ba1f029cedcb1.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}
2 changes: 1 addition & 1 deletion site.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Data.Tuple (swap)
import Hakyll
--------------------------------------------------------------------------------
main :: IO ()
main = hakyll $ do
main = hakyllWith defaultConfiguration {providerDirectory = "./public", destinationDirectory = "./site"} $ do
match "images/*" $ do
route idRoute
compile copyFileCompiler
Expand Down

0 comments on commit 3eacbd5

Please sign in to comment.