Skip to content

Commit 15b352d

Browse files
committed
feat(home): ✨ add deploy script
1 parent 859a8b1 commit 15b352d

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

.github/workflows/next.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish Libraries
2+
'on':
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
build_and_deploy:
9+
runs-on: ubuntu-latest
10+
permissions: write-all
11+
steps:
12+
- name: Checkout repo ✅
13+
uses: actions/checkout@v2
14+
with:
15+
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
16+
fetch-depth: 0
17+
- name: NRWL setup ✅
18+
uses: nrwl/nx-set-shas@v3
19+
20+
- name: Install Dependencies 🔧
21+
run: |
22+
if [ -e yarn.lock ]; then
23+
yarn install --frozen-lockfile
24+
elif [ -e package-lock.json ]; then
25+
npm ci
26+
else
27+
npm i
28+
fi
29+
- name: Pretty code 💄
30+
run: npx nx format:check
31+
- name: Lint ♻️
32+
run: npx nx affected -t lint --all --parallel=true
33+
- name: Build 📦
34+
run: npx nx affected -t build --all --parallel=true
35+
- name: Test 🧪
36+
run: npx nx affected -t test --all --ci --code-coverage --parallel=true
37+
- name: Release 🚀
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
41+
run: npx nx run-many --target=deploy --parallel=false

apps/home/project.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,23 @@
9090
}
9191
}
9292
},
93+
"deploy": {
94+
"executor": "@theunderscorer/nx-semantic-release:semantic-release",
95+
"options": {
96+
"branches": [
97+
"+([0-9])?(.{+([0-9]),x}).x",
98+
"master",
99+
"next",
100+
"next-major",
101+
{ "name": "beta", "prerelease": true },
102+
{ "name": "alpha", "prerelease": true }
103+
],
104+
"github": true,
105+
"changelog": true,
106+
"npm": false,
107+
"tagFormat": "HomeApp-v${VERSION}"
108+
}
109+
},
93110
"serve-static": {
94111
"executor": "@nrwl/web:file-server",
95112
"options": {

0 commit comments

Comments
 (0)