create-harper 1.13.1 → 1.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -56,7 +56,7 @@ Put data access in **server actions** (see [`app/actions.js`](./app/actions.js))
|
|
|
56
56
|
|
|
57
57
|
## Deployment
|
|
58
58
|
|
|
59
|
-
Your app deploys from GitHub: every pull request runs lint
|
|
59
|
+
Your app deploys from GitHub: every pull request runs lint and `next build`, and merging to `main` deploys to your Harper cluster with the included [GitHub Actions workflow](./.github/workflows/deploy.yaml). No Harper password or token is stored in GitHub.
|
|
60
60
|
|
|
61
61
|
First, head to [https://fabric.harper.fast/](https://fabric.harper.fast/), log in, and create a cluster. Then log your local CLI in to it as a super user:
|
|
62
62
|
|
|
@@ -95,7 +95,7 @@ The deploy user can deploy any app on the cluster, so who can deploy comes down
|
|
|
95
95
|
|
|
96
96
|
### What a deploy does
|
|
97
97
|
|
|
98
|
-
The workflow runs `next build
|
|
98
|
+
The workflow's test job runs `next build`, and the deploy job uploads the project with that `.next` build, so no build runs on the cluster (building there currently fails; see the note in [`config.yaml`](./config.yaml)). The build stays out of the deploy job, so your dependencies' install and build scripts never run where the OIDC token can be requested. It deploys with `restart=rolling`: each node restarts in turn, so the cluster keeps serving. On Harper 5.4 and later, each node first loads the release in a canary worker, and only serves it if it loads. A release that fails to load is rejected, the run fails and names the node, and the previous release keeps serving.
|
|
99
99
|
|
|
100
100
|
The run's summary names the deployment and its `certification`:
|
|
101
101
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Tests every pull request, and deploys to your Harper cluster when a change merges to `main`. The
|
|
2
2
|
# deploy job holds no Harper credential: its `harper` commands authenticate with GitHub's OIDC token
|
|
3
3
|
# under a trust policy on the cluster. Set that up once with
|
|
4
|
-
# `your-package-manager-run-here deploy:setup-ci` (see "Deployment" in the README). The
|
|
5
|
-
# runs `next build` and uploads it, because building on the cluster
|
|
6
|
-
# (HarperFast/nextjs#57, HarperFast/nextjs#58).
|
|
4
|
+
# `your-package-manager-run-here deploy:setup-ci` (see "Deployment" in the README). The test job
|
|
5
|
+
# runs `next build` and hands it to the deploy job, which uploads it, because building on the cluster
|
|
6
|
+
# currently fails (HarperFast/nextjs#57, HarperFast/nextjs#58).
|
|
7
7
|
name: Deploy to Harper
|
|
8
8
|
on:
|
|
9
9
|
pull_request:
|
|
@@ -38,6 +38,20 @@ jobs:
|
|
|
38
38
|
run: your-package-manager-install-here
|
|
39
39
|
- name: Run lint
|
|
40
40
|
run: your-package-manager-run-here lint
|
|
41
|
+
- name: Build
|
|
42
|
+
run: your-package-manager-run-here build
|
|
43
|
+
- name: Hand the build to the deploy job
|
|
44
|
+
# Building here keeps your dependencies' scripts out of the job that can request an OIDC token.
|
|
45
|
+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
|
|
46
|
+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
47
|
+
with:
|
|
48
|
+
name: next-build
|
|
49
|
+
path: |
|
|
50
|
+
.next/
|
|
51
|
+
!.next/cache/
|
|
52
|
+
include-hidden-files: true
|
|
53
|
+
# A re-run of the whole workflow builds again, under the same name.
|
|
54
|
+
overwrite: true
|
|
41
55
|
|
|
42
56
|
deploy:
|
|
43
57
|
needs: test
|
|
@@ -63,16 +77,15 @@ jobs:
|
|
|
63
77
|
with:
|
|
64
78
|
# The deploy uploads this directory, `.git` included, so keep the job's token out of it.
|
|
65
79
|
persist-credentials: false
|
|
66
|
-
|
|
80
|
+
- name: Download the build
|
|
81
|
+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
82
|
+
with:
|
|
83
|
+
name: next-build
|
|
84
|
+
path: .next
|
|
67
85
|
- name: Set up Node.js
|
|
68
86
|
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
69
87
|
with:
|
|
70
|
-
# your-package-manager-node-cache-here
|
|
71
88
|
node-version-file: '.nvmrc'
|
|
72
|
-
- name: Install dependencies
|
|
73
|
-
run: your-package-manager-install-here
|
|
74
|
-
- name: Build
|
|
75
|
-
run: your-package-manager-run-here build
|
|
76
89
|
- name: Install Harper CLI
|
|
77
90
|
# 5.3 is the first CLI that authenticates with the OIDC token.
|
|
78
91
|
run: npm install --global harper@^5.3
|
|
@@ -56,7 +56,7 @@ Put data access in **server actions** (see [`app/actions.ts`](./app/actions.ts))
|
|
|
56
56
|
|
|
57
57
|
## Deployment
|
|
58
58
|
|
|
59
|
-
Your app deploys from GitHub: every pull request runs lint
|
|
59
|
+
Your app deploys from GitHub: every pull request runs lint and `next build`, and merging to `main` deploys to your Harper cluster with the included [GitHub Actions workflow](./.github/workflows/deploy.yaml). No Harper password or token is stored in GitHub.
|
|
60
60
|
|
|
61
61
|
First, head to [https://fabric.harper.fast/](https://fabric.harper.fast/), log in, and create a cluster. Then log your local CLI in to it as a super user:
|
|
62
62
|
|
|
@@ -95,7 +95,7 @@ The deploy user can deploy any app on the cluster, so who can deploy comes down
|
|
|
95
95
|
|
|
96
96
|
### What a deploy does
|
|
97
97
|
|
|
98
|
-
The workflow runs `next build
|
|
98
|
+
The workflow's test job runs `next build`, and the deploy job uploads the project with that `.next` build, so no build runs on the cluster (building there currently fails; see the note in [`config.yaml`](./config.yaml)). The build stays out of the deploy job, so your dependencies' install and build scripts never run where the OIDC token can be requested. It deploys with `restart=rolling`: each node restarts in turn, so the cluster keeps serving. On Harper 5.4 and later, each node first loads the release in a canary worker, and only serves it if it loads. A release that fails to load is rejected, the run fails and names the node, and the previous release keeps serving.
|
|
99
99
|
|
|
100
100
|
The run's summary names the deployment and its `certification`:
|
|
101
101
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Tests every pull request, and deploys to your Harper cluster when a change merges to `main`. The
|
|
2
2
|
# deploy job holds no Harper credential: its `harper` commands authenticate with GitHub's OIDC token
|
|
3
3
|
# under a trust policy on the cluster. Set that up once with
|
|
4
|
-
# `your-package-manager-run-here deploy:setup-ci` (see "Deployment" in the README). The
|
|
5
|
-
# runs `next build` and uploads it, because building on the cluster
|
|
6
|
-
# (HarperFast/nextjs#57, HarperFast/nextjs#58).
|
|
4
|
+
# `your-package-manager-run-here deploy:setup-ci` (see "Deployment" in the README). The test job
|
|
5
|
+
# runs `next build` and hands it to the deploy job, which uploads it, because building on the cluster
|
|
6
|
+
# currently fails (HarperFast/nextjs#57, HarperFast/nextjs#58).
|
|
7
7
|
name: Deploy to Harper
|
|
8
8
|
on:
|
|
9
9
|
pull_request:
|
|
@@ -38,6 +38,20 @@ jobs:
|
|
|
38
38
|
run: your-package-manager-install-here
|
|
39
39
|
- name: Run lint
|
|
40
40
|
run: your-package-manager-run-here lint
|
|
41
|
+
- name: Build
|
|
42
|
+
run: your-package-manager-run-here build
|
|
43
|
+
- name: Hand the build to the deploy job
|
|
44
|
+
# Building here keeps your dependencies' scripts out of the job that can request an OIDC token.
|
|
45
|
+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
|
|
46
|
+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
47
|
+
with:
|
|
48
|
+
name: next-build
|
|
49
|
+
path: |
|
|
50
|
+
.next/
|
|
51
|
+
!.next/cache/
|
|
52
|
+
include-hidden-files: true
|
|
53
|
+
# A re-run of the whole workflow builds again, under the same name.
|
|
54
|
+
overwrite: true
|
|
41
55
|
|
|
42
56
|
deploy:
|
|
43
57
|
needs: test
|
|
@@ -63,16 +77,15 @@ jobs:
|
|
|
63
77
|
with:
|
|
64
78
|
# The deploy uploads this directory, `.git` included, so keep the job's token out of it.
|
|
65
79
|
persist-credentials: false
|
|
66
|
-
|
|
80
|
+
- name: Download the build
|
|
81
|
+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
82
|
+
with:
|
|
83
|
+
name: next-build
|
|
84
|
+
path: .next
|
|
67
85
|
- name: Set up Node.js
|
|
68
86
|
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
69
87
|
with:
|
|
70
|
-
# your-package-manager-node-cache-here
|
|
71
88
|
node-version-file: '.nvmrc'
|
|
72
|
-
- name: Install dependencies
|
|
73
|
-
run: your-package-manager-install-here
|
|
74
|
-
- name: Build
|
|
75
|
-
run: your-package-manager-run-here build
|
|
76
89
|
- name: Install Harper CLI
|
|
77
90
|
# 5.3 is the first CLI that authenticates with the OIDC token.
|
|
78
91
|
run: npm install --global harper@^5.3
|