Skip to content

Commit a1c35ee

Browse files
committed
util: Add build workflow
1 parent d2153da commit a1c35ee

3 files changed

Lines changed: 106 additions & 4 deletions

File tree

.editorconfig

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,50 @@
11
root = true
22

33
[*]
4-
max_line_length = 300
4+
max_line_length = 120
55
indent_style = space
66
indent_size = 2
77
end_of_line = lf
88
insert_final_newline = true
99
trim_trailing_whitespace = true
1010
charset = utf-8
1111

12+
[{*.{json,yml,html,css,scss,sass,svg,drawio,md},go.mod,go.sum}]
13+
max_line_length = unset
14+
1215
[*.go]
1316
indent_style = tab
1417

15-
[*.md]
16-
trim_trailing_whitespace = false
17-
1818
[Makefile]
1919
indent_style = tab
2020
indent_size = 2
21+
22+
[*.drawio]
23+
insert_final_newline = false
24+
25+
[{*.go,*.md,*.svg}]
26+
trim_trailing_whitespace = false
27+
28+
[{*.json,*.svg,LICENSE}]
29+
insert_final_newline = unset
30+
31+
[{*.svg}]
32+
end_of_line = unset
33+
34+
[{*.go,*.svg,*.html,LICENSE}]
35+
indent_size = unset
36+
indent_style = unset
37+
38+
[*.{go,js}]
39+
# Allow C-style doc comments
40+
block_comment_start = /*
41+
block_comment = *
42+
block_comment_end = */
43+
44+
[{go.mod,go.sum}]
45+
indent_style = tab
46+
47+
[doc/themes/the-things-stack/layouts/shortcodes/*.html]
48+
indent_size = unset
49+
indent_style = unset
50+
insert_final_newline = false

.github/workflows/pull_request.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Pull request
2+
3+
on: pull_request
4+
5+
jobs:
6+
build:
7+
name: Build docs
8+
runs-on: ubuntu-18.04
9+
steps:
10+
- name: Check out code
11+
uses: actions/checkout@v2
12+
- name: Set up Go
13+
uses: actions/setup-go@v2
14+
with:
15+
go-version: '~1.15'
16+
- name: Initialize Go module cache
17+
uses: actions/cache@v2
18+
with:
19+
path: ~/go/pkg/mod
20+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
21+
restore-keys: |
22+
${{ runner.os }}-go-
23+
- name: Editor config
24+
uses: snow-actions/[email protected]
25+
- name: Build docs
26+
run: make build.public
27+
env:
28+
HUGO_BASE_URL: https://thethingsstack.io/
29+
HUGO_GOOGLEANALYTICS: ${{ secrets.HUGO_GOOGLEANALYTICS }}
30+
HUGO_PARAMS_FEEDBACK_CAMPAIGN: ${{ secrets.HUGO_PARAMS_FEEDBACK_CAMPAIGN }}
31+
HUGO_PARAMS_FEEDBACK_ENABLED: true
32+
HUGO_PARAMS_INTERCOM_APPID: ${{ secrets.HUGO_PARAMS_INTERCOM_APPID }}
33+
HUGO_PARAMS_INTERCOM_ENABLED: true
34+
HUGO_PARAMS_SEARCH_APIKEY: ${{ secrets.HUGO_PARAMS_SEARCH_APIKEY }}
35+
HUGO_PARAMS_SEARCH_ENABLED: true
36+
HUGO_PARAMS_SEARCH_INDEX: thethingsstack

.github/workflows/release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
release:
10+
name: Release docs
11+
runs-on: ubuntu-18.04
12+
steps:
13+
- name: Check out code
14+
uses: actions/checkout@v2
15+
- name: Set up Go
16+
uses: actions/setup-go@v2
17+
with:
18+
go-version: '~1.15'
19+
- name: Build docs
20+
run: make build.public
21+
env:
22+
HUGO_BASE_URL: https://thethingsstack.io/
23+
HUGO_GOOGLEANALYTICS: ${{ secrets.HUGO_GOOGLEANALYTICS }}
24+
HUGO_PARAMS_FEEDBACK_CAMPAIGN: ${{ secrets.HUGO_PARAMS_FEEDBACK_CAMPAIGN }}
25+
HUGO_PARAMS_FEEDBACK_ENABLED: true
26+
HUGO_PARAMS_INTERCOM_APPID: ${{ secrets.HUGO_PARAMS_INTERCOM_APPID }}
27+
HUGO_PARAMS_INTERCOM_ENABLED: true
28+
HUGO_PARAMS_SEARCH_APIKEY: ${{ secrets.HUGO_PARAMS_SEARCH_APIKEY }}
29+
HUGO_PARAMS_SEARCH_ENABLED: true
30+
HUGO_PARAMS_SEARCH_INDEX: thethingsstack
31+
- name: Deploy documentation to Github pages
32+
uses: JamesIves/github-pages-deploy-action@releases/v3
33+
with:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
BRANCH: gh-pages
36+
FOLDER: public

0 commit comments

Comments
 (0)