Skip to content

Commit cf38000

Browse files
committed
Merge branch 'develop' into mochi-web-preview
2 parents bb0d5f9 + 17b9916 commit cf38000

File tree

10 files changed

+1148
-21
lines changed

10 files changed

+1148
-21
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Vercel Preview Deployment
2+
env:
3+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
4+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
5+
on:
6+
release:
7+
types: [prereleased]
8+
jobs:
9+
Deploy-Preview:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Install Node.js
14+
uses: actions/setup-node@v3
15+
with:
16+
node-version: 18
17+
- uses: pnpm/action-setup@v2
18+
name: Install pnpm
19+
id: pnpm-install
20+
with:
21+
version: 7
22+
run_install: false
23+
- name: Install Vercel CLI
24+
run: npm install --global vercel@latest
25+
- name: Pull Vercel Environment Information
26+
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
27+
- name: Build Project Artifacts
28+
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
29+
- name: Deploy Project Artifacts to Vercel
30+
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}

.github/workflows/deploy-mochi-web.yml renamed to .github/workflows/deploy-mochi-web-prod.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ env:
44
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
55
on:
66
workflow_dispatch:
7+
release:
8+
types: [released]
79
jobs:
810
Deploy-Production:
911
runs-on: ubuntu-latest
@@ -23,5 +25,7 @@ jobs:
2325
run: pnpm add --global vercel@latest
2426
- name: Pull Vercel Environment Information
2527
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
28+
- name: Build Project Artifacts
29+
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
2630
- name: Deploy Project Artifacts to Vercel
27-
run: vercel deploy --prod --no-wait --token=${{ secrets.VERCEL_TOKEN }}
31+
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}

.github/workflows/release-web.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release web
2+
3+
on:
4+
push:
5+
branches:
6+
- cicd
7+
- main
8+
- mochi-web-preview
9+
10+
permissions:
11+
contents: read # for checkout
12+
13+
jobs:
14+
release-web:
15+
permissions:
16+
contents: write # to be able to publish a GitHub release
17+
issues: write # to be able to comment on released issues
18+
pull-requests: write # to be able to comment on released pull requests
19+
id-token: write # to enable use of OIDC for npm provenance
20+
name: release
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v3 # v3
24+
with:
25+
fetch-depth: 0 # to be able to checkout any commit
26+
persist-credentials: false # <--- this
27+
- uses: pnpm/action-setup@v2
28+
with:
29+
version: 6.32.9
30+
- uses: actions/setup-node@v3 # v3
31+
with:
32+
cache: pnpm
33+
node-version: 18
34+
- name: Install dependencies
35+
run: pnpm install
36+
# pinned version updated automatically by Renovate.
37+
# details at https://semantic-release.gitbook.io/semantic-release/usage/installation#global-installation
38+
- run: pnpm dlx [email protected]
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}

.releaserc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"branches": [
3+
"main",
4+
{
5+
"name": "mochi-web-preview",
6+
"prerelease": "rc"
7+
},
8+
{
9+
"name": "cicd",
10+
"prerelease": "ci"
11+
}
12+
],
13+
"plugins": [
14+
"@semantic-release/commit-analyzer",
15+
[
16+
"@semantic-release/npm",
17+
{
18+
"npmPublish": false,
19+
"pkgRoot": "apps/mochi-web"
20+
}
21+
],
22+
[
23+
"@semantic-release/github",
24+
{
25+
"successComment": false
26+
}
27+
],
28+
["@semantic-release/git", {
29+
"assets": ["apps/mochi-web/package.json"]
30+
}]
31+
]
32+
}

Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
RELEASE_BRANCH=main
2+
BETA_BRANCH=mochi-web-preview
3+
DEVELOP_BRANCH=develop
4+
5+
.PHONY: release
6+
release:
7+
git checkout $(BETA_BRANCH) && git pull origin $(BETA_BRANCH) && \
8+
git checkout $(RELEASE_BRANCH) && git pull origin $(RELEASE_BRANCH) && \
9+
git merge $(BETA_BRANCH) --no-edit --no-ff && \
10+
git push origin $(RELEASE_BRANCH) && \
11+
git checkout $(DEVELOP_BRANCH)
12+
13+
.PHONY: release-preview
14+
release-preview: sync-release
15+
git checkout $(DEVELOP_BRANCH) && git pull origin $(DEVELOP_BRANCH) && \
16+
git checkout $(BETA_BRANCH) && git pull origin $(BETA_BRANCH) && \
17+
git merge $(DEVELOP_BRANCH) --no-edit --no-ff && \
18+
git push origin $(BETA_BRANCH) && \
19+
git checkout $(DEVELOP_BRANCH) && git push origin $(DEVELOP_BRANCH)
20+
21+
.PHONY: sync-release
22+
sync-release:
23+
git checkout $(RELEASE_BRANCH) && git pull origin $(RELEASE_BRANCH) && \
24+
git checkout $(BETA_BRANCH) && git pull origin $(BETA_BRANCH) && \
25+
git merge $(RELEASE_BRANCH) --no-edit --no-ff

apps/mochi-web/components/Header/Header.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use client'
22

3-
import { isMobile } from '~utils/isMobile'
43
import Link from 'next/link'
54
import { useRouter } from 'next/router'
65
import { ROUTES } from '~constants/routes'
@@ -551,9 +550,7 @@ export const Header = () => {
551550
<DesktopNav
552551
navItems={desktopNavItems}
553552
className={
554-
isLoggedIn && profile && isMobile() && window.innerWidth <= 1024
555-
? '!flex'
556-
: ''
553+
isLoggedIn && profile && window.innerWidth <= 1024 ? '!flex' : ''
557554
}
558555
/>
559556
</>

apps/mochi-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "mochi-web",
33
"private": true,
4-
"version": "1.2.1",
4+
"version": "1.0.0-ci.5",
55
"scripts": {
66
"proxy-ssl": "local-ssl-proxy --config proxy-config.json",
77
"dev:https": "(trap 'kill 0' SIGINT; pnpm proxy-ssl & next dev -p 3001)",

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"@changesets/cli": "^2.27.1",
4646
"@commitlint/cli": "^17.8.0",
4747
"@commitlint/config-conventional": "^17.8.0",
48+
"@semantic-release/git": "^10.0.1",
4849
"@storybook/react": "^7.4.6",
4950
"@swc-node/jest": "^1.6.8",
5051
"@swc/core": "^1.3.96",

0 commit comments

Comments
 (0)