setup automatic frontend deployment #1
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 frontend | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
types: | |
- opened | |
- synchronize | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
deployments: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup bun | |
uses: oven-sh/setup-bun@v2 | |
- name: Install dependencies | |
working-directory: apps/frontend | |
run: bun install --frozen-lockfile | |
- name: Build | |
working-directory: apps/frontend | |
run: bun run build | |
- name: Publish to Cloudflare Pages | |
uses: cloudflare/pages-action@main | |
with: | |
apiToken: ${{ secrets.CF_PAGES_API_TOKEN }} | |
accountId: ${{ secrets.CF_ACCOUNT_ID }} | |
projectName: data-maki | |
directory: ./dist/client | |
workingDirectory: apps/frontend | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
wranglerVersion: "3" |