name: Deploy Pages
on:
  push:
    branches:
      - 'master'
jobs:
  deploy:
    runs-on: ubuntu-latest
    permissions:
      contents: read
    container: alpine:latest
    timeout-minutes: 60
    steps:
      - run: apk add nodejs npm rsync
      - uses: actions/checkout@v4
      - run: mkdir /tmp/deploy
      - run: rsync -ua --exclude=".*" . /tmp/deploy
      - name: Build & Deploy Worker
        uses: cloudflare/wrangler-action@v3
        with:
          apiToken: ${{ secrets.CF_API_TOKEN }}
          accountId: ${{ secrets.CF_ACCOUNT_ID }}
          command: pages deploy /tmp/deploy --project-name=ctmesh-org
