forked from italia/developers.italia.it
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
133 lines (116 loc) · 3.4 KB
/
config.yml
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Javascript Node CircleCI 2.1 configuration file
#
# Check https://circleci.com/docs/reference-2-1/#section=configuration for more details
version: 2.1
references:
working_directory: /tmp/developers
load_image: &load_image
docker:
- image: circleci/ruby:2.6.0-node-browsers
env_vars_test: &env_vars_test
environment:
- JEKYLL_ENV: "production"
- NOKOGIRI_USE_SYSTEM_LIBRARIES: "true"
- ELASTICSEARCH_URL: "" # Disable searchyll for test.
env_vars_prod: &env_vars_prod
environment:
- JEKYLL_ENV: "production"
- NOKOGIRI_USE_SYSTEM_LIBRARIES: "true"
install_dependencies: &install_dependencies
run:
name: install-dependencies
command: |
make include-npm-deps
make bundle-install-deployment
which rsync || sudo apt-get install rsync
get_crawler_yml_files: &get_crawler_yml_files
run:
name: get-crawler-yml-files
command: |
make download-data
build_bundle_jekyll: &build_bundle_jekyll
run:
name: build-bundle-jekyll
command: |
make jekyll-build
make test
setup_ssh_gh_pages: &setup_ssh_gh_pages
add_ssh_keys:
fingerprints:
# gh-pages deployment key from circle-ci config
- ef:89:bb:6b:43:11:55:29:e1:8f:10:f0:fd:c8:7f:58
publish_changes_gh_pages: &publish_changes_gh_pages
run:
name: publish_changes_gh_pages
command: |
cp -r .well-known _site/
# Make GitHub skip its Jekyll support and serve all the files
# we built with our own Jekyll. This includes dotfiles.
touch _site/.nojekyll
echo developers.italia.it > _site/CNAME
npm run deploy -- --dotfiles -m "Automated deployment: ${CIRCLE_SHA1} [ci skip]"
# In order to use this, the integration needs to be
# setup first under CircleCI app directory and a
# SLACK_WEBOOK environment variable needs to be set
# in the project settings
notify_on_failure: ¬ify_on_failure
slack/status:
fail_only: true
only_for_branches: master
jobs:
test:
<<: *load_image
<<: *env_vars_test
steps:
- checkout
- << : *install_dependencies
- << : *get_crawler_yml_files
- run: make github-import
- << : *build_bundle_jekyll
- << : *notify_on_failure
build_and_deploy_gh_pages:
<<: *load_image
<<: *env_vars_prod
steps:
- checkout
- << : *install_dependencies
- << : *get_crawler_yml_files
- run: make github-import
- << : *build_bundle_jekyll
- << : *setup_ssh_gh_pages
- << : *publish_changes_gh_pages
- << : *notify_on_failure
orbs:
slack: circleci/[email protected]
workflows:
# Every night, deploy to VMs and to gh-pages
# to make sure latest data are shown
daily-build-and-deploy:
triggers:
- schedule:
cron: "0 6 * * *"
filters:
branches:
only:
- master
jobs:
- build_and_deploy_gh_pages
# For any branch other than master,
# run CI tests at each commit
on-commit-test:
jobs:
- test:
filters:
branches:
ignore:
- master
- gh-pages
# For each commit on the master branch
# deploy to VMs and to gh-pages
on-commit-build-and-deploy:
jobs:
- build_and_deploy_gh_pages:
filters:
branches:
only:
- master