Skip to content

Commit

Permalink
other: Deploy to NuxtHub (#59)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
k-miyake authored Sep 13, 2024
1 parent e5d98f5 commit 3c39d7c
Show file tree
Hide file tree
Showing 4 changed files with 721 additions and 6 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Deploy to Cloudflare with NuxtHub Cli
on:
push:
branches: [main]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.7.1
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Deploy with nuxt-hub cli
run: npx nuxthub deploy
env:
NUXT_HUB_PROJECT_KEY: ${{ secrets.NUXT_HUB_PROJECT_KEY}}
NUXT_HUB_USER_TOKEN: ${{ secrets.NUXT_HUB_USER_TOKEN }}
3 changes: 2 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default defineNuxtConfig({
'~/modules/template-loader',
'~/modules/nuxt-link',
'@nuxt/image',
'@nuxthub/core',
],
colorMode: {
classSuffix: '',
Expand Down Expand Up @@ -133,4 +134,4 @@ export default defineNuxtConfig({
},

compatibilityDate: '2024-04-03',
})
})
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@nuxt/icon": "^1.4.7",
"@nuxt/image": "^1.7.0",
"@nuxt/kit": "^3.12.4",
"@nuxthub/core": "^0.7.14",
"@nuxtjs/color-mode": "^3.4.4",
"@nuxtjs/seo": "2.0.0-rc.10",
"@pinia/nuxt": "^0.5.3",
Expand Down
Loading

0 comments on commit 3c39d7c

Please sign in to comment.