-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (86 loc) · 3.02 KB
/
update-docs.yml
File metadata and controls
88 lines (86 loc) · 3.02 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
83
84
85
86
87
88
name: Build and Deploy Component Library Docs
on:
push:
branches:
- master
pull_request:
env:
# Serve Docs runs an http server that cannot be shared across matrix machines, would be cool to figure that out
NX_CLOUD_DISTRIBUTED_EXECUTION: false
jobs:
cypress-docs:
runs-on: ubuntu-latest
strategy:
matrix:
machines: [1, 2, 3]
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'yarn'
- uses: actions/cache@v2
id: yarn-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install Deps
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn
- run: npx nx-cloud start-ci-run
- name: Run E2E Tests
uses: cypress-io/github-action@v2
timeout-minutes: 10
with:
record: true
parallel: true
start: npx nx serve-docs ui-components
project: packages/ui-components-e2e
command-prefix: 'percy exec --parallel -- npx'
wait-on: 'http://localhost:6007'
wait-on-timeout: 120
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
PERCY_PARALLEL_TOTAL: 3
- name: Stop NX Agents
run: npx nx-cloud stop-all-agents
build-docs:
needs: cypress-docs
if: ${{ github.event_name != 'pull_request' }}
runs-on: ubuntu-latest
steps:
# Check out code
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'yarn'
- name: Build docs
run: yarn && npx nx-cloud start-ci-run
- run: npx nx build-docs ui-components
- run: npx nx-cloud stop-all-agents
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
# And make it available for the builds
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
file: deploy/Dockerfile
tags: lambdacurry/component-library-docs:${{ github.sha }}
- name: Helm Update
uses: WyriHaximus/github-action-helm3@v2
with:
exec: helm repo add lambdacurry https://charts.lambdacurry.dev --username lambdacurry --password ${{ secrets.LAMBDACURRY_CHART_PASSWORD }} && helm upgrade component-library-docs --reuse-values --set images.nginx.tag=${{ github.sha }} --set images.nginx.repository=lambdacurry/component-library-docs lambdacurry/static-site -n component-library
kubeconfig: '${{ secrets.EKS_KUBECONFIG }}'