Skip to content

Commit 08b14b1

Browse files
updated actions
1 parent f89c25b commit 08b14b1

File tree

2 files changed

+148
-28
lines changed

2 files changed

+148
-28
lines changed

.github/workflows/main.yaml

+73-13
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,125 @@
1-
name: Vercel Preview Deployment
1+
name: Production Deployment
2+
23
env:
34
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
45
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
6+
57
on:
68
push:
79
branches:
810
- main
11+
912
jobs:
1013
Setup:
1114
runs-on: ubuntu-latest
1215
steps:
13-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v3
17+
1418
- uses: actions/setup-node@v3
1519
with:
1620
node-version: 20
21+
cache: "yarn"
22+
23+
- name: Create .npmrc for Tiptap
24+
run: |
25+
echo "@tiptap-pro:registry=https://registry.tiptap.dev/" > .npmrc
26+
echo "//registry.tiptap.dev/:_authToken=${TIPTAP_PRO_TOKEN}" >> .npmrc
27+
env:
28+
TIPTAP_PRO_TOKEN: ${{ secrets.TIPTAP_PRO_TOKEN }}
29+
1730
- name: Install Dependencies
18-
run: yarn install
31+
run: yarn install --frozen-lockfile
32+
33+
- name: Cache Build
34+
uses: actions/cache@v3
35+
with:
36+
path: |
37+
.next
38+
node_modules
39+
.npmrc
40+
key: ${{ runner.os }}-build-${{ hashFiles('**/yarn.lock') }}
1941

2042
Check:
2143
needs: Setup
2244
runs-on: ubuntu-latest
2345
steps:
24-
- uses: actions/checkout@v2
46+
- uses: actions/checkout@v3
47+
2548
- uses: actions/setup-node@v3
2649
with:
2750
node-version: 20
28-
- name: Install Dependencies
29-
run: yarn install
51+
cache: "yarn"
52+
53+
- name: Restore Cache
54+
uses: actions/cache@v3
55+
with:
56+
path: |
57+
.next
58+
node_modules
59+
.npmrc
60+
key: ${{ runner.os }}-build-${{ hashFiles('**/yarn.lock') }}
61+
3062
- name: Type Check
3163
run: yarn run tsc
64+
3265
- name: Lint
3366
run: yarn run lint
3467

3568
Database:
3669
needs: Check
3770
runs-on: ubuntu-latest
3871
steps:
39-
- uses: actions/checkout@v2
72+
- uses: actions/checkout@v3
73+
4074
- uses: actions/setup-node@v3
4175
with:
4276
node-version: 20
43-
- name: Install Dependencies
44-
run: yarn install
77+
cache: "yarn"
78+
79+
- name: Restore Cache
80+
uses: actions/cache@v3
81+
with:
82+
path: |
83+
.next
84+
node_modules
85+
.npmrc
86+
key: ${{ runner.os }}-build-${{ hashFiles('**/yarn.lock') }}
87+
4588
- name: Push DB Changes
4689
run: yarn run db:push
4790

4891
Deploy:
4992
needs: Database
5093
runs-on: ubuntu-latest
5194
steps:
52-
- uses: actions/checkout@v2
95+
- uses: actions/checkout@v3
96+
5397
- uses: actions/setup-node@v3
5498
with:
5599
node-version: 20
56-
- name: Install Dependencies
57-
run: yarn install
100+
cache: "yarn"
101+
102+
- name: Restore Cache
103+
uses: actions/cache@v3
104+
with:
105+
path: |
106+
.next
107+
node_modules
108+
.npmrc
109+
key: ${{ runner.os }}-build-${{ hashFiles('**/yarn.lock') }}
110+
58111
- name: Install Vercel CLI
59-
run: yarn install --global vercel@latest
112+
run: yarn global add vercel@latest
113+
60114
- name: Pull Vercel Environment Information
61115
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
116+
62117
- name: Build Project Artifacts
63118
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
119+
64120
- name: Deploy Project Artifacts to Vercel
65121
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
122+
123+
- name: Cleanup
124+
if: always()
125+
run: rm -f .npmrc

.github/workflows/preview.yaml

+75-15
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,125 @@
1-
name: Vercel Preview Deployment
1+
name: Preview Deployment
2+
23
env:
34
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
45
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
6+
57
on:
68
push:
79
branches-ignore:
810
- main
11+
912
jobs:
1013
Setup:
1114
runs-on: ubuntu-latest
1215
steps:
13-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v3
17+
1418
- uses: actions/setup-node@v3
1519
with:
1620
node-version: 20
21+
cache: "yarn"
22+
23+
- name: Create .npmrc for Tiptap
24+
run: |
25+
echo "@tiptap-pro:registry=https://registry.tiptap.dev/" > .npmrc
26+
echo "//registry.tiptap.dev/:_authToken=${TIPTAP_PRO_TOKEN}" >> .npmrc
27+
env:
28+
TIPTAP_PRO_TOKEN: ${{ secrets.TIPTAP_PRO_TOKEN }}
29+
1730
- name: Install Dependencies
18-
run: yarn install
31+
run: yarn install --frozen-lockfile
32+
33+
- name: Cache Build
34+
uses: actions/cache@v3
35+
with:
36+
path: |
37+
.next
38+
node_modules
39+
.npmrc
40+
key: ${{ runner.os }}-build-${{ hashFiles('**/yarn.lock') }}
1941

2042
Check:
2143
needs: Setup
2244
runs-on: ubuntu-latest
2345
steps:
24-
- uses: actions/checkout@v2
46+
- uses: actions/checkout@v3
47+
2548
- uses: actions/setup-node@v3
2649
with:
2750
node-version: 20
28-
- name: Install Dependencies
29-
run: yarn install
51+
cache: "yarn"
52+
53+
- name: Restore Cache
54+
uses: actions/cache@v3
55+
with:
56+
path: |
57+
.next
58+
node_modules
59+
.npmrc
60+
key: ${{ runner.os }}-build-${{ hashFiles('**/yarn.lock') }}
61+
3062
- name: Type Check
31-
run: yarn tsc
63+
run: yarn run tsc
64+
3265
- name: Lint
33-
run: yarn lint
66+
run: yarn run lint
3467

3568
Database:
3669
needs: Check
3770
runs-on: ubuntu-latest
3871
steps:
39-
- uses: actions/checkout@v2
72+
- uses: actions/checkout@v3
73+
4074
- uses: actions/setup-node@v3
4175
with:
4276
node-version: 20
43-
- name: Install Dependencies
44-
run: yarn install
77+
cache: "yarn"
78+
79+
- name: Restore Cache
80+
uses: actions/cache@v3
81+
with:
82+
path: |
83+
.next
84+
node_modules
85+
.npmrc
86+
key: ${{ runner.os }}-build-${{ hashFiles('**/yarn.lock') }}
87+
4588
- name: Push DB Changes
46-
run: yarn db:push
89+
run: yarn run db:push
4790

4891
Deploy:
4992
needs: Database
5093
runs-on: ubuntu-latest
5194
steps:
52-
- uses: actions/checkout@v2
95+
- uses: actions/checkout@v3
96+
5397
- uses: actions/setup-node@v3
5498
with:
5599
node-version: 20
56-
- name: Install Dependencies
57-
run: yarn install
100+
cache: "yarn"
101+
102+
- name: Restore Cache
103+
uses: actions/cache@v3
104+
with:
105+
path: |
106+
.next
107+
node_modules
108+
.npmrc
109+
key: ${{ runner.os }}-build-${{ hashFiles('**/yarn.lock') }}
110+
58111
- name: Install Vercel CLI
59112
run: yarn global add vercel@latest
113+
60114
- name: Pull Vercel Environment Information
61115
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
116+
62117
- name: Build Project Artifacts
63118
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
119+
64120
- name: Deploy Project Artifacts to Vercel
65121
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
122+
123+
- name: Cleanup
124+
if: always()
125+
run: rm -f .npmrc

0 commit comments

Comments
 (0)