mirror of
https://github.com/blackboxprogramming/new_world.git
synced 2026-03-17 04:57:10 -05:00
34 lines
811 B
YAML
34 lines
811 B
YAML
name: "🚀 Auto Deploy"
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
deploy:
|
|
name: Deploy to Cloudflare Pages
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Install & Build
|
|
run: |
|
|
if [ -f "package.json" ]; then
|
|
npm install
|
|
npm run build 2>/dev/null || true
|
|
fi
|
|
|
|
- name: Deploy to Cloudflare Pages
|
|
uses: cloudflare/wrangler-action@v3
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
command: pages deploy . --project-name=${{ github.event.repository.name }}
|