diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml new file mode 100644 index 0000000..d049638 --- /dev/null +++ b/.gitea/workflows/deploy.yaml @@ -0,0 +1,46 @@ + +name: Generate a build and push to Cloudflare Pages + +on: + push: + branches: + - prod + +jobs: + build: + runs-on: ubuntu-latest + name: Build and Deploy to Cloudflare Pages + + steps: + - name: git-checkout + uses: actions/checkout@v5 + + - name: pnpm-setup + uses: pnpm/action-setup@v4 + with: + version: 10 + + - name: Install Node.js + uses: actions/setup-node@v6 + with: + node-version: 24 + cache: pnpm + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build + run: pnpm build + + - name: Deploy + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + command: pages deploy ./build --project-name="2eInk" + + + + + + diff --git a/package.json b/package.json index f54ba76..3125d8d 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "lint": "prettier --check . && eslint .", - "format": "prettier --write ." + "format": "prettier --write .", + "push:prod": "git push origin main:prod" }, "devDependencies": { "@eslint/compat": "^2.0.4",