This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Cloudflare | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set Node.js 16.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- name: Run install | |
uses: borales/actions-yarn@v4 | |
with: | |
cmd: install | |
- name: Run Build | |
uses: borales/actions-yarn@v4 | |
with: | |
cmd: build | |
env: | |
BASE_URL: ${{ secrets.BASE_URL }} | |
- name: Build & Deploy Worker | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
command: pages deploy build --project-name=${{ secrets.CLOUDFLARE_PROJECT_NAME }} |