Repository navigation
82 lines (69 loc) · 2.01 KB
/
Copy pathdocs-deploy.yml
File metadata and controls
82 lines (69 loc) · 2.01 KB
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
name: Deploy Docs
on:
push:
paths:
- 'docs/**'
- '.github/workflows/docs-deploy.yml'
branches:
- master
- prod
jobs:
build-deploy:
name: Verify + Build + Deploy
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.0
with:
access_token: ${{ github.token }}
- name: Checkout Repo
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2.2.0
with:
node-version: 14
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Dependencies
uses: actions/cache@v2.1.6
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-docs-yarn-${{ hashFiles('**/yarn.lock') }}
# Removed due to causing failed builds
# - name: Cache Gatsby Build
# uses: actions/cache@v2.1.6
# with:
# path: docs/.cache
# key: ${{ runner.os }}-docs-build
- name: Install Dependencies
env:
CYPRESS_INSTALL_BINARY: 0 # Skip installing of cypress
run: |
yarn install --frozen-lockfile
yarn --cwd docs install --frozen-lockfile
- name: Verify
run: |
yarn lint:docs
- name: Build
run: |
yarn --cwd docs build
- name: Archive Build Artifact
uses: actions/upload-artifact@master
with:
name: docs
path: docs/public
- name: Deploy to Firebase
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
GITHUB_HEAD_REF: ${{ github.head_ref }}
GITHUB_REF: ${{ github.ref }}
run: |
$(yarn bin)/firebase-ci deploy --only hosting:docs
- name: Archive Debug Log
uses: actions/upload-artifact@v2
if: failure()
with:
name: firebase-debug
path: firebase-debug.log