diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..9f191ac --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,43 @@ +on: [push] + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + deployments: write + name: Publish to Cloudflare Pages + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Add pnpm + run: yarn global add pnpm + + - name: Install deps + run: pnpm install + + - name: Vite build + run: pnpm build + + - name: Publish to Cloudflare Pages + uses: cloudflare/pages-action@v1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: a5854f55e71b087aa3a3bcdae74b2489 + projectName: combinator + directory: "./dist" + # Optional: Enable this if you want to have GitHub Deployments triggered + gitHubToken: ${{ secrets.GITHUB_TOKEN }} + # Optional: Switch what branch you are publishing to. + # By default this will be the branch which triggered this workflow + branch: master + # Optional: Change the working directory + workingDirectory: frontend + # Optional: Change the Wrangler version, allows you to point to a specific version or a tag such as `beta` + wranglerVersion: "3"