-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add wrangler and @askcodebase/next-on-pages deps
- Loading branch information
Showing
3 changed files
with
2,218 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Build and Publish to Cloudflare | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16.17' | ||
|
||
- name: Install pnpm & jq | ||
run: | | ||
npm install -g pnpm | ||
sudo apt-get install jq | ||
- name: Cache Node.js modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.pnpm-store | ||
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm- | ||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Build project | ||
run: pnpm cf:build | ||
|
||
- name: Deploy to Production Environment | ||
run: pnpm cf:github:publish -- --branch=${{ github.ref }} --commit-hash=${{ github.sha }} --commit-message="${{ github.event.head_commit.message }}" | ||
env: | ||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
{ | ||
"name": "nextra-docs-template", | ||
"name": "askcodebase-docs", | ||
"version": "0.0.1", | ||
"description": "Nextra docs template", | ||
"description": "AskCodebase Docs", | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "next build", | ||
"start": "next start" | ||
"start": "next start", | ||
"cf:build": "npx @askcodebase/next-on-pages", | ||
"cf:github:publish": "CLOUDFLARE_ACCOUNT_ID=$CLOUDFLARE_ACCOUNT_ID CLOUDFLARE_API_TOKEN=$CLOUDFLARE_API_TOKEN && wrangler pages deploy --project-name askcodebase-docs .vercel/output/static" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/shuding/nextra-docs-template.git" | ||
}, | ||
"author": "Shu Ding <[email protected]>", | ||
"author": "AskCodebase <[email protected]>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/shuding/nextra-docs-template/issues" | ||
|
@@ -26,10 +28,12 @@ | |
"react-dom": "^18.2.0" | ||
}, | ||
"devDependencies": { | ||
"@askcodebase/next-on-pages": "^0.1.0", | ||
"@types/node": "18.11.10", | ||
"autoprefixer": "^10.4.14", | ||
"postcss": "^8.4.24", | ||
"tailwindcss": "^3.3.2", | ||
"typescript": "^4.9.3" | ||
"typescript": "^4.9.3", | ||
"wrangler": "^3.5.1" | ||
} | ||
} |
Oops, something went wrong.