Skip to content

🚧 bun run test #75

🚧 bun run test

🚧 bun run test #75

Workflow file for this run

name: cloudflare
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, '[skip ci]') == false
steps:
- name: πŸ“₯ Checkout repository
uses: actions/checkout@v3
- name: πŸ“Έ Calculate commit hash
id: sha
uses: pr-mpt/actions-commit-hash@v2
- name: πŸ”¨ Prepare Node environment
uses: actions/setup-node@v4
with:
node-version: 22
- name: πŸ”¨ Prepare Bun environment
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: πŸŽ‰ Install project dependencies
run: bun i
- name: πŸ” Decrypt .envs
run: bun dotenvx decrypt -f .env -f .env.production
env:
DOTENV_PRIVATE_KEY: ${{ secrets.DOTENV_PRIVATE_KEY }}
DOTENV_PRIVATE_KEY_PRODUCTION: ${{ secrets.DOTENV_PRIVATE_KEY_PRODUCTION }}
- name: πŸ—οΈ Build app
run: bun run build
- name: πŸš€ Deploy to Cloudflare Pages
id: cloudflare_pages_deploy
uses: cloudflare/[email protected]
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
command: "pages deploy . --project-name wkb"
workingDirectory: ./dist
env:
NODE_VERSION: 22
- name: πŸš€ Deploy pages based on commit sha
uses: actions/github-script@v6
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 / build (push)",
description: "Commit based deploy",
state: "success",
sha,
target_url: "https://wkb.pages.dev",
});