Skip to content

Commit

Permalink
chore: add deploy yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dvaJi committed Oct 19, 2023
1 parent 5362e8a commit 393de38
Show file tree
Hide file tree
Showing 3 changed files with 2,275 additions and 55 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
on:
workflow_call:

jobs:
ci:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write

name: Deploy to Cloudflare Pages
steps:
- uses: actions/setup-node@v3
with:
node-version: 18

- name: Checkout
uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 8
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
env:
NODE_OPTIONS: --max_old_space_size=8192

- name: Create env file
run: |
echo "${{ secrets.ENV_FILE }}" > .env
- name: Build
run: pnpm dlx @cloudflare/next-on-pages@1
env:
NITRO_PRESET: cloudflare_pages
NODE_OPTIONS: --max_old_space_size=8192

- name: Publish to CF Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
projectName: genshinbuilds
directory: .vercel/output/static
branch: master
wranglerVersion: "3"
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
},
"devDependencies": {
"@builder.io/partytown": "^0.8.1",
"@cloudflare/next-on-pages": "^1.7.1",
"@next/bundle-analyzer": "^13.5.4",
"@next/env": "^13.5.4",
"@types/leaflet": "^1.9.6",
Expand All @@ -70,13 +71,15 @@
"cross-env": "^7.0.3",
"eslint": "8.47.0",
"eslint-config-next": "^13.5.4",
"eslint-plugin-next-on-pages": "^1.7.1",
"globby": "^13.2.2",
"postcss": "^8.4.31",
"prettier": "^3.0.3",
"prettier-plugin-organize-imports": "^3.2.3",
"prettier-plugin-tailwindcss": "^0.5.5",
"prisma": "^5.4.2",
"tailwindcss": "^3.3.3",
"typescript": "5.1.6"
"typescript": "5.1.6",
"vercel": "^32.4.1"
}
}
Loading

1 comment on commit 393de38

@vercel
Copy link

@vercel vercel bot commented on 393de38 Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.