-
Notifications
You must be signed in to change notification settings - Fork 6
136 lines (111 loc) · 3.9 KB
/
deploy.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Publish Release
on:
push:
branches: [master]
jobs:
setup:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
token: ${{ secrets.BOT_TOKEN }}
fetch-depth: 0
ref: 'master'
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v3
with:
main-branch-name: 'master'
- name: Set Node Version
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
cache-dependency-path: 'yarn.lock'
# - name: Get yarn cache directory path
# id: yarn-cache-dir-path
# run: |
# echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
# - name: Restore yarn cache
# uses: actions/cache@v3
# id: yarn-cache
# with:
# path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# restore-keys: |
# ${{ runner.os }}-yarn-
# - name: Artifactory Check
# run: yarn check:registry
- name: Install Dependencies
run: yarn install --immutable
- name: Lint Source Code
run: yarn lint
- name: Unit Tests
run: yarn test:ci
- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
file: ./coverage/coverage-final.json
token: ${{ secrets.CODECOV_TOKEN }}
- name: Build Packages
run: yarn build
release:
needs: [setup]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.BOT_TOKEN }}
fetch-depth: 0
ref: 'master'
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v3
with:
main-branch-name: 'master'
- name: Set Node Version
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
cache-dependency-path: 'yarn.lock'
# - name: Get yarn cache directory path
# id: yarn-cache-dir-path
# run: |
# echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
# - name: Restore yarn cache
# uses: actions/cache@v3
# id: yarn-cache
# with:
# path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# restore-keys: |
# ${{ runner.os }}-yarn-
- name: Install Dependencies
run: yarn install --immutable
- name: Build Packages
run: yarn build
- name: Setup Publish Config
run: |
yarn config set npmAuthToken "${{ secrets.NPM_TOKEN }}"
git config --global user.email ${{ secrets.GH_EMAIL }}
git config --global user.name ${{ secrets.GH_USER }}
# TODO: ngx-deploy-npm? Or continue to leverage nx + yarn npm publish command?
- name: Publish
run: |
yarn nx affected --target version --parallel=1
yarn nx affected --target publish --parallel=1
git push && git push --tags
- name: Build Docs
run: yarn build:docs
- name: Deploy Docs
uses: crazy-max/ghaction-github-pages@v3
with:
target_branch: gh-pages
build_dir: docusaurus/build
commit_message: deployed docs [skip ci]
committer: ${{ secrets.GH_USER }} ${{ secrets.GH_EMAIL }}
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}