Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit 3c39d7c

Browse files
authored
other: Deploy to NuxtHub (#59)
* feat: Add GitHub Actions workflow for deploying to Cloudflare with NuxtHub Cli * chore: Update branch name in GitHub Actions workflow for deploying to Cloudflare with NuxtHub Cli * Add @nuxthub/core package and module * chore: Update deploy workflow to include pull requests (#68) * chore: Update pnpm version in deploy workflow * chore: Update deploy workflow to exclude pull requests
1 parent e5d98f5 commit 3c39d7c

File tree

4 files changed

+721
-6
lines changed

4 files changed

+721
-6
lines changed

.github/workflows/deploy.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Deploy to Cloudflare with NuxtHub Cli
2+
on:
3+
push:
4+
branches: [main]
5+
jobs:
6+
build-and-deploy:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v4
11+
- uses: pnpm/action-setup@v4
12+
name: Install pnpm
13+
with:
14+
version: 9.7.1
15+
run_install: false
16+
- name: Install Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 20
20+
cache: pnpm
21+
- name: Get pnpm store directory
22+
shell: bash
23+
run: |
24+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
25+
- uses: actions/cache@v4
26+
name: Setup pnpm cache
27+
with:
28+
path: ${{ env.STORE_PATH }}
29+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
30+
restore-keys: |
31+
${{ runner.os }}-pnpm-store-
32+
- name: Install dependencies
33+
run: pnpm install
34+
- name: Deploy with nuxt-hub cli
35+
run: npx nuxthub deploy
36+
env:
37+
NUXT_HUB_PROJECT_KEY: ${{ secrets.NUXT_HUB_PROJECT_KEY}}
38+
NUXT_HUB_USER_TOKEN: ${{ secrets.NUXT_HUB_USER_TOKEN }}

nuxt.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export default defineNuxtConfig({
1717
'~/modules/template-loader',
1818
'~/modules/nuxt-link',
1919
'@nuxt/image',
20+
'@nuxthub/core',
2021
],
2122
colorMode: {
2223
classSuffix: '',
@@ -133,4 +134,4 @@ export default defineNuxtConfig({
133134
},
134135

135136
compatibilityDate: '2024-04-03',
136-
})
137+
})

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"@nuxt/icon": "^1.4.7",
5050
"@nuxt/image": "^1.7.0",
5151
"@nuxt/kit": "^3.12.4",
52+
"@nuxthub/core": "^0.7.14",
5253
"@nuxtjs/color-mode": "^3.4.4",
5354
"@nuxtjs/seo": "2.0.0-rc.10",
5455
"@pinia/nuxt": "^0.5.3",

0 commit comments

Comments
 (0)