diff options
author | MATSUKI Hidenori <mazgi@users.noreply.github.com> | 2018-10-07 19:31:11 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-07 19:31:11 +0300 |
commit | 1d559fbe950112564196eed00754be8ff293ea4f (patch) | |
tree | 976dcbb0149fd236bdb7d8c925a2bfe18cdcf5b6 | |
parent | dbbed96000a85f5c7d8183828a679d0eabbac0ed (diff) | |
parent | 06119c1e91a85e8210aebfb7af0127f282482236 (diff) |
Merge pull request #1 from mazgi/setup-circleci
Setup CircleCI
-rw-r--r-- | .circleci/config.yml | 27 | ||||
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | example-site/.gitignore | 1 | ||||
-rw-r--r-- | example-site/config.toml | 1 | ||||
-rw-r--r-- | example-site/docker-compose.yml | 2 | ||||
-rw-r--r-- | example-site/firebase.json | 10 | ||||
-rw-r--r-- | layouts/partials/header.html | 4 |
7 files changed, 45 insertions, 4 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..314eb05 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,27 @@ +defaults: &defaults + working_directory: techlog-simple + docker: + - image: mazgi/hugo-static-website:hugo-0.49-2018.10.1 + +version: 2 +jobs: + deploy_to_firebase: + <<: *defaults + steps: + - checkout + - run: cd example-site && sed -i '1ipublishDir = "public/techlog-simple"' config.toml + - run: + name: Build Website + command: cd example-site && hugo --baseURL="https://${GCLOUD_PROJECT}.firebaseapp.com/techlog-simple" --themesDir="../.." + - run: + name: Deploy to Firebase + command: cd example-site && firebase deploy --project="${GCLOUD_PROJECT}" --token="${FIREBASE_TOKEN}" + +workflows: + version: 2 + build_and_deploy: + jobs: + - deploy_to_firebase: + filters: + branches: + only: master @@ -1 +1,5 @@ # hugo-theme-techlog-simple + +[![CircleCI](https://circleci.com/gh/mazgi/hugo-theme-techlog-simple.svg?style=svg)](https://circleci.com/gh/mazgi/hugo-theme-techlog-simple) + +Example: https://mazgi-hugo-themes-gcp.firebaseapp.com/techlog-simple/ diff --git a/example-site/.gitignore b/example-site/.gitignore index 87174b6..d76897d 100644 --- a/example-site/.gitignore +++ b/example-site/.gitignore @@ -1 +1,2 @@ /public/ +/.firebase/ diff --git a/example-site/config.toml b/example-site/config.toml index 4493274..ed203ab 100644 --- a/example-site/config.toml +++ b/example-site/config.toml @@ -2,7 +2,6 @@ baseURL = "http://example.org/" languageCode = "en-us" title = "A Hugo theme" theme = "techlog-simple" -themesDir = "../.." defaultContentLanguage = "en" # defaultContentLanguage = "ja" hasCJKLanguage = true diff --git a/example-site/docker-compose.yml b/example-site/docker-compose.yml index 42df212..11714b7 100644 --- a/example-site/docker-compose.yml +++ b/example-site/docker-compose.yml @@ -3,7 +3,7 @@ services: website: build: . working_dir: /techlog-simple/example-site - command: hugo server --bind 0.0.0.0 --buildDrafts + command: hugo server --themesDir="../.." --bind 0.0.0.0 --buildDrafts volumes: - ../:/techlog-simple ports: diff --git a/example-site/firebase.json b/example-site/firebase.json new file mode 100644 index 0000000..e782939 --- /dev/null +++ b/example-site/firebase.json @@ -0,0 +1,10 @@ +{ + "hosting": { + "public": "public", + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ] + } +} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index dff87a9..1d8dcaf 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -3,12 +3,12 @@ <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> - <link rel="shortcut icon" href="{{ .Site.BaseURL }}common/favicon.ico"> + <link rel="shortcut icon" href="{{ "common/favicon.ico" | relURL }}"> <!-- Bootstrap CDN: https://getbootstrap.com/docs/4.0/getting-started/introduction/ --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> <!-- Font Awesome CDN: https://www.bootstrapcdn.com/fontawesome/ --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous"> - <link rel="stylesheet" href="{{ "/common/site.css" | relURL }}"> + <link rel="stylesheet" href="{{ "common/site.css" | relURL }}"> <!-- Open Graph: https://developers.facebook.com/docs/plugins/share-button --> {{ if .Page.IsHome }} <title>{{ .Site.Title }}</title> |