This repository has been archived by the owner on Feb 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
78 lines (76 loc) · 2.4 KB
/
documentation.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
name: main
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
checks:
if: github.event_name != 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e
- uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
with:
node-version: "14.x"
- name: Test Build
env:
GA_KEY: "dummy"
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
run: |
if [ -e yarn.lock ]; then
yarn install --frozen-lockfile
elif [ -e package-lock.json ]; then
npm ci
else
npm i
fi
npm run build
- id: auth
uses: google-github-actions/[email protected]
with:
credentials_json: ${{ secrets.PROD_DOCS_GITOPS_UPLOAD }}
- id: upload-file
uses: google-github-actions/[email protected]
with:
path: build
destination: staging.docs.gitops.weave.works
parent: false
gh-release:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e
- uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
with:
node-version: "14.x"
- uses: weaveworks/webfactory-ssh-agent@6b2f2c5354ff41f1edbbf7a17ea9b6178c89be9f
with:
ssh-private-key: ${{ secrets.WEAVE_GITOPS_DOCS_WEAVEWORKS_DOCS_BOT_DEPLOY_KEY }}
- name: Release to GitHub Pages
env:
USE_SSH: true
GIT_USER: git
GA_KEY: ${{ secrets.GA_KEY }}
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "weaveworks-docs-bot"
if [ -e yarn.lock ]; then
yarn install --frozen-lockfile
elif [ -e package-lock.json ]; then
npm ci
else
npm i
fi
npm run build
- id: auth
uses: google-github-actions/[email protected]
with:
credentials_json: ${{ secrets.PROD_DOCS_GITOPS_UPLOAD }}
- id: upload-file
uses: google-github-actions/[email protected]
with:
path: build
destination: production.docs.gitops.weave.works
parent: false