Skip to content

Commit 4708577

Browse files
committed
ci: setup nuxthub deployment
1 parent 863a2c1 commit 4708577

File tree

4 files changed

+91
-18
lines changed

4 files changed

+91
-18
lines changed

.github/workflows/production.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,24 @@ jobs:
2929
node-version: 20
3030
cache: 'pnpm'
3131

32-
- name: Install dependencies
33-
run: pnpm install --frozen-lockfile
32+
- name: Get pnpm store directory
33+
shell: bash
34+
run: |
35+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
3436
35-
- name: Build
36-
run: pnpm run generate
37+
- uses: actions/cache@v4
38+
name: Setup pnpm cache
39+
with:
40+
path: ${{ env.STORE_PATH }}
41+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
42+
restore-keys: |
43+
${{ runner.os }}-pnpm-store-
3744
38-
- name: Check for empty payloads
39-
run: |-
40-
! grep -rnw './.output/public/' -e 'null},prerenderedAt'
45+
- name: Install dependencies
46+
run: pnpm install --frozen-lockfile
4147

42-
- name: Deploy to Netlify
43-
uses: jsmrcaga/[email protected]
44-
with:
45-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
46-
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
47-
NETLIFY_DEPLOY_MESSAGE: 'Deployed from GitHub action'
48-
NETLIFY_DEPLOY_TO_PROD: true
49-
build_directory: './.output/public'
50-
install_command: 'echo Skipping installing the dependencies'
51-
build_command: 'echo Skipping building the web files'
48+
- name: Deploy with nuxthub
49+
run: npx nuxthub deploy
50+
env:
51+
NUXT_HUB_PROJECT_KEY: ${{ secrets.NUXT_HUB_PROJECT_KEY}}
52+
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
@@ -14,7 +14,8 @@ export default defineNuxtConfig({
1414
'nuxt-booster',
1515
'@vee-validate/nuxt',
1616
'@nuxt/eslint',
17-
'vuetify-nuxt-module'
17+
'vuetify-nuxt-module',
18+
'@nuxthub/core',
1819
],
1920
css: [
2021
'@fontsource/roboto/300.css',

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"@fontsource/roboto": "^5.1.0",
2323
"@mdi/font": "^7.4.47",
2424
"@nuxt/eslint": "^0.7.2",
25+
"@nuxthub/core": "0.8.7",
2526
"@nuxtjs/i18n": "^9.1.1",
2627
"@nuxtjs/sitemap": "^7.0.0",
2728
"@nuxtjs/tailwindcss": "^6.12.2",

pnpm-lock.yaml

Lines changed: 70 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)