first attempts at GitLab pages
This commit is contained in:
parent
faec92ae37
commit
445140da96
2
.gitignore
vendored
2
.gitignore
vendored
@ -5,7 +5,7 @@
|
|||||||
.stack-work
|
.stack-work
|
||||||
|
|
||||||
_cache
|
_cache
|
||||||
_site
|
public
|
||||||
|
|
||||||
**/#*#
|
**/#*#
|
||||||
**/.#*
|
**/.#*
|
||||||
|
|||||||
29
.gitlab-ci.yml
Normal file
29
.gitlab-ci.yml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
image: nixpkgs/nix-flakes
|
||||||
|
|
||||||
|
workflow:
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_BRANCH
|
||||||
|
|
||||||
|
cache:
|
||||||
|
paths:
|
||||||
|
- .stack-work
|
||||||
|
- _cache
|
||||||
|
|
||||||
|
pages:
|
||||||
|
stage: deploy
|
||||||
|
script: &build-script
|
||||||
|
- nix develop -c stack run site -- build
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- public
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_BRANCH == "main"
|
||||||
|
|
||||||
|
test:
|
||||||
|
stage: test
|
||||||
|
script: *build-script
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- public
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_BRANCH != "main"
|
||||||
1
_redirects
Normal file
1
_redirects
Normal file
@ -0,0 +1 @@
|
|||||||
|
/ /index.html 200
|
||||||
@ -9,7 +9,10 @@ import Data.Maybe
|
|||||||
import System.FilePath
|
import System.FilePath
|
||||||
|
|
||||||
config :: Configuration
|
config :: Configuration
|
||||||
config = defaultConfiguration
|
config =
|
||||||
|
defaultConfiguration
|
||||||
|
{ destinationDirectory = "public"
|
||||||
|
}
|
||||||
|
|
||||||
stripPathPrefix :: FilePath -> Routes
|
stripPathPrefix :: FilePath -> Routes
|
||||||
stripPathPrefix (splitDirectories -> prefix) =
|
stripPathPrefix (splitDirectories -> prefix) =
|
||||||
@ -18,6 +21,10 @@ stripPathPrefix (splitDirectories -> prefix) =
|
|||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = hakyllWith config $ do
|
main = hakyllWith config $ do
|
||||||
|
match "_redirects" $ do
|
||||||
|
route idRoute
|
||||||
|
compile copyFileCompiler
|
||||||
|
|
||||||
match "content/index.html" $ do
|
match "content/index.html" $ do
|
||||||
route $ stripPathPrefix "content"
|
route $ stripPathPrefix "content"
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user