Skip to content

Commit

Permalink
Build directly master on GtiHub Pages etalab#90
Browse files Browse the repository at this point in the history
* Don't build site on CircleCI before deploy

* Add config flag

* Add CNAME
  • Loading branch information
AntoineAugusti authored Aug 8, 2019
1 parent a27e887 commit 576a29f
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 64 deletions.
52 changes: 1 addition & 51 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ jobs:
build:
docker:
- image: circleci/ruby:2.3-stretch

working_directory: ~/doc.data.gouv.fr

steps:
- checkout

Expand All @@ -19,51 +16,4 @@ jobs:

- run:
name: Build website
command: bundle exec jekyll build --verbose

- persist_to_workspace:
root: .
paths:
- _site

deploy:
docker:
- image: circleci/python:3.6

working_directory: ~/doc.data.gouv.fr

steps:
- add_ssh_keys:
fingerprints:
- "81:43:ff:eb:30:0a:85:4a:a1:cc:34:29:93:8d:6e:89"
- checkout
- attach_workspace:
at: .
- run:
name: Expose user pip-installed binaries on path
command: echo 'export PATH=$HOME/.local/bin:$PATH' >> $BASH_ENV
- run:
name: Deploy to github pages
command: |
pip install --user ghp-import
cp -R .circleci _site/
git config --global user.name CircleCI
git config --global user.email circleci@data.gouv.fr
ghp-import --cname=doc.data.gouv.fr -m "Deploy doc.data.gouv.fr" --push _site
workflows:
version: 2
build-and-deploy:
jobs:
# Build on any branch except github pages
- build:
filters:
branches:
ignore: gh-pages
# Deploy only on master
- deploy:
requires:
- build
filters:
branches:
only: master
command: bundle exec jekyll build --config _config.yml,_config_dev.yml --verbose
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
doc.data.gouv.fr
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Compiler et démarrer un serveur de documentation :
git clone https://github.com/etalab/doc.data.gouv.fr
cd doc.data.gouv.fr
bundle install
bundle exec jekyll serve
bundle exec jekyll serve --config _config.yml,_config_dev.yml --incremental
```

La documentation apparaîtra alors à l’adresse suivante : <a href="http://localhost:4000">http://localhost:4000</a>.
Expand Down
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ defaults:
sass:
style: compressed

theme: jekyll-theme-gouvfr
remote_theme: etalab/template-jekyll

plugins:
- jekyll-redirect-from
1 change: 1 addition & 0 deletions _config_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-gouvfr
10 changes: 0 additions & 10 deletions deploy

This file was deleted.

2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'
services:
web:
image: jekyll/jekyll:latest
command: jekyll serve --watch --force_polling -H 0.0.0.0 -P 4000
command: jekyll serve --config _config.yml,_config_dev.yml --watch --force_polling -H 0.0.0.0 -P 4000
ports:
- 4000:4000
- 35729:35729
Expand Down

0 comments on commit 576a29f

Please sign in to comment.