-
Notifications
You must be signed in to change notification settings - Fork 28
/
config.yml
70 lines (63 loc) · 1.68 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
---
# https://circleci.com/docs/2.0/configuration-reference
version: 2.1
orbs:
hugo: circleci/[email protected]
workflows:
main:
jobs:
- hugo/build:
asciidoc: true
html-proofer: true
htmlproofer-http-status-ignore: "'0,999'"
htmlproofer-url-ignore: "'/inventory/'"
htmlproofer-timeframe: "'6w'"
version: "latest"
- html-tidy:
filters:
branches:
only: main
requires:
- hugo/build
- deploy:
filters:
branches:
only: main
requires:
- hugo/build
- html-tidy
jobs:
html-tidy:
docker:
- image: cimg/ruby:3.0
steps:
- run: gem install htmlbeautifier
- attach_workspace:
at: .
- run: htmlbeautifier --tab $(find public/ -name '*.html' -print)
- persist_to_workspace:
root: .
paths:
- public
deploy:
docker:
- image: cibuilds/base:latest
working_directory: ~/hugo
environment:
HUGO_BUILD_DIR: ~/hugo/inventory/public
steps:
# add repository deploy key (for pull/push access)
- add_ssh_keys:
fingerprints:
- "21:74:62:c8:10:59:77:7c:9d:96:cf:c8:69:84:1f:bb"
# deploy.sh dependencies
- run: apk add rsync
# clone repo (required to access `.circleci/deploy.sh`)
- run: git clone --depth=1 https://github.com/unicef/inventory.git
# checkout generated html
- attach_workspace:
at: inventory
# deploy to production
- deploy:
name: Deploy to GitHub Pages
command: ./inventory/.circleci/deploy.sh