-
Notifications
You must be signed in to change notification settings - Fork 1
97 lines (93 loc) · 3.39 KB
/
main.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
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Site workflow
on:
push:
branches:
# Only accept deploying from the main branch
- main
jobs:
test:
name: App linting/testing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup NodeJS LTS
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup Angular problem matchers
uses: EdricChan03/[email protected]
- name: Cache node modules
uses: actions/cache@v3
id: node_modules_cache
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}-
${{ runner.os }}-node_modules-
${{ runner.os }}-
- name: Install dependencies
# Skip this step if a cache hit occurs on the key
if: steps.node_modules_cache.outputs.cache-hit != 'true'
run: npm ci
- name: Lint application
run: npm run lint
- name: Test application
run: npm run action:test
- name: Upload Codecov coverage report
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/rss-reader/lcov.info
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup NodeJS LTS
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup Angular problem matchers
uses: EdricChan03/[email protected]
- name: Cache node modules
uses: actions/cache@v3
id: node_modules_cache
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}-
${{ runner.os }}-node_modules-
- name: Install dependencies
# Skip this step if a cache hit occurs on the key
if: steps.node_modules_cache.outputs.cache-hit != 'true'
run: npm ci
- name: Cache documentation
uses: actions/cache@v3
id: docs_cache
with:
path: projects/rss-reader/src/assets/docs
key: ${{ runner.os }}-docs-${{ hashFiles('docs/**') }}
restore-keys: |
${{ runner.os }}-docs-${{ hashFiles('docs/**' )}}-
${{ runner.os }}-docs-
- name: Generate documentation
# Skip this step if a cache hit occurs on the key
if: steps.docs_cache.outputs.cache-hit != 'true'
run: npm run genDocs
- name: Generate Storybook
run: npm run build-storybook
- name: Deploy site
run: npm run action:deploy
env:
# GH_TOKEN: ${{ secrets.DEPLOY_GH_PAGES_TOKEN }}
# Interesting note: The GITHUB_TOKEN secret has the deployments scope
# w/ read/write access for repositories.
# See https://help.github.com/en/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token#permissions-for-the-github_token
# for more info.
# Note: This will be commented until support for automatically building
# the deployed results (a la GitHub Pages + Jekyll) arrives.
# See https://github.community/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/m-p/26869
# for more info.
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}