chore: translate content #243
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: Code quality and deploy | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
statuses: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: 'latest' | |
- name: Install dependencies | |
run: bun install | |
- name: Build project | |
run: bun run build | |
- name: biome check | |
run: bun run check:ci | |
- name: Deploy to Cloudflare Pages | |
id: cloudflare_pages_deploy | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
projectName: "yossydev-blog" | |
accountId: ${{ secrets.ACCOUNT_ID }} | |
directory: './dist' | |
- name: Add publish URL as commit status | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const sha = context.payload.pull_request?.head.sha ?? context.sha; | |
await github.rest.repos.createCommitStatus({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
context: 'Cloudflare Pages', | |
description: 'Cloudflare Pages deployment', | |
state: 'success', | |
sha, | |
target_url: "${{ steps.cloudflare_pages_deploy.outputs.url }}", | |
}); |