-
Notifications
You must be signed in to change notification settings - Fork 67
84 lines (82 loc) · 3.02 KB
/
release.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
name: Release
on:
push:
branches:
- master
jobs:
release:
name: Release docs
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "~1.23"
- name: Get Go module cache directory path
id: go-module-cache-dir-path
run: echo "::set-output name=dir::$(go env GOMODCACHE)"
- name: Initialize Go module cache
uses: actions/cache@v3
with:
path: ${{ steps.go-module-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download Go dependencies
run: make go.deps
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: "~16"
- name: Get Yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(npx yarn cache dir)"
- name: Initialize Yarn module cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Download Yarn dependencies
run: make js.deps
- name: Initialize Hugo binary cache
id: cache-hugo
uses: actions/cache@v3
with:
path: hugo.linux
key: ${{ runner.os }}-hugo-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-hugo-
- name: Build Hugo binary
if: steps.cache-hugo.outputs.cache-hit != 'true'
run: make hugo.linux
- name: Build docs
run: make build.public
env:
HUGO: ./hugo.linux
HUGO_BASE_URL: https://www.thethingsindustries.com/docs/
HUGO_PARAMS_GTM_ID: ${{ secrets.HUGO_PARAMS_GTM_ID }}
HUGO_PARAMS_FEEDBACK_CAMPAIGN: ${{ secrets.HUGO_PARAMS_FEEDBACK_CAMPAIGN }}
HUGO_PARAMS_FEEDBACK_ENABLED: true
HUGO_PARAMS_INTERCOM_APPID: ${{ secrets.HUGO_PARAMS_INTERCOM_APPID }}
HUGO_PARAMS_INTERCOM_ENABLED: true
HUGO_PARAMS_SEARCH_APPID: ${{ secrets.HUGO_PARAMS_SEARCH_APPID }}
HUGO_PARAMS_SEARCH_APIKEY: ${{ secrets.HUGO_PARAMS_SEARCH_APIKEY }}
HUGO_PARAMS_SEARCH_ENABLED: true
HUGO_PARAMS_SEARCH_INDEX: thethingsstack
- name: Deploy documentation to Github pages
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: public
- name: Make gateways.csv
run: make gateways.csv
- name: Sync gateways.csv to airtable
run: |
curl -X POST ${{ secrets.AIRTABLE_GATEWAYS_API_ENDPOINT }} -H "Authorization: Bearer ${{ secrets.AIRTABLE_GATEWAYS_API_KEY }}" -H "Content-Type: text/csv" --data-binary "@gateways.csv"