-
Notifications
You must be signed in to change notification settings - Fork 7
54 lines (52 loc) · 1.9 KB
/
zen-ci-cd.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
name: Publish Documentation
on:
push:
branches:
- master
- main
jobs:
publish-docs:
name: Publish documentation
runs-on: ubuntu-latest
# runs-on: [self-hosted, zendesk-stable]
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
steps:
- uses: zendesk/checkout@v3
- uses: zendesk/setup-node@v3
with:
node-version: 16
- id: find-yarn-cache-folder
name: Find Yarn's cache folder
run: echo "::set-output name=path::$(yarn config get cacheFolder)"
- name: Cache Yarn's cache folder
uses: zendesk/[email protected]
with:
path: ${{ steps.find-yarn-cache-folder.outputs.path }}
key: yarn-cache-folder-os-${{ runner.os }}-node-${{ env.node-version }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn-cache-folder-os-${{ runner.os }}-node-${{ env.node-version }}-
yarn-cache-folder-os-${{ runner.os }}-
- id: find-yarn-cache-folder-docs
name: Find Docs Yarn's cache folder
run: |
cd docs
echo "::set-output name=path::$(yarn config get cacheFolder)"
- name: Cache Docs Yarn's cache folder
uses: zendesk/[email protected]
with:
path: ${{ steps.find-yarn-cache-folder-docs.outputs.path }}
key: yarn-cache-folder-docs-os-${{ runner.os }}-node-${{ env.node-version }}-${{ hashFiles('docs/yarn.lock') }}
restore-keys: |
yarn-cache-folder-docs-os-${{ runner.os }}-node-${{ env.node-version }}-
yarn-cache-folder-docs-os-${{ runner.os }}-
- name: Install dependencies
run: |
yarn install --immutable
cd docs
yarn install --immutable
- name: Build and release docs
run: |
cd docs
./deploy.sh
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}