diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0106cbf..0ca96f7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,8 +7,7 @@ on: branches: [ main, master ] permissions: - contents: write - pages: write + contents: read jobs: build-and-deploy: @@ -16,12 +15,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: - node-version: '20' + node-version: '25.2.1' cache: 'npm' - name: Install dependencies @@ -30,9 +29,13 @@ jobs: - name: Build run: npm run build - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v4 - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./.output/public + - name: Install Wrangler + run: npm install -g wrangler + if: github.ref == 'refs/heads/main' + + - name: Deploy to Cloudflare Workers + if: github.ref == 'refs/heads/main' + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + run: wrangler --cwd .output deploy