Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/build-onlyagent-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build OnlyAgent web app

on:
push:
branches:
- onlyagent-reskin
paths-ignore:
- 'docs/**'
workflow_dispatch:

permissions:
contents: write

concurrency:
group: onlyagent-web-build
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: onlyagent-reskin
fetch-depth: 0

- name: Use Node 20
uses: actions/setup-node@v4
with:
node-version: '20.19.5'

- name: Install dependencies
run: npm install

- name: Build site into docs
env:
NODE_OPTIONS: --openssl-legacy-provider --max-old-space-size=4096
run: npm run build

- name: Commit generated site
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add docs
if git diff --cached --quiet; then
echo "No generated changes"
exit 0
fi
git commit -m "Build OnlyAgent web app"
git push origin HEAD:onlyagent-reskin
55 changes: 55 additions & 0 deletions .github/workflows/deploy-onlyagent-cloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Deploy OnlyAgent Cloud

on:
push:
branches:
- onlyagent-reskin
paths:
- 'onlyagent-cloud/**'
- '.github/workflows/deploy-onlyagent-cloud.yml'
workflow_dispatch:

permissions:
contents: read

jobs:
deploy:
runs-on: ubuntu-latest
env:
CF_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CF_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node 22
uses: actions/setup-node@v4
with:
node-version: '22'

- name: Install Worker dependencies
working-directory: onlyagent-cloud
run: npm install

- name: Validate Worker bundle
working-directory: onlyagent-cloud
run: npx wrangler deploy --dry-run --outdir .wrangler-dry-run

- name: Check Cloudflare credentials
id: credentials
shell: bash
run: |
if [ -n "$CF_API_TOKEN" ] && [ -n "$CF_ACCOUNT_ID" ]; then
echo "configured=true" >> "$GITHUB_OUTPUT"
else
echo "configured=false" >> "$GITHUB_OUTPUT"
echo "Cloudflare Worker bundle validated. Actual deployment is waiting for GitHub secrets CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID."
fi

- name: Deploy Worker and custom domains
if: steps.credentials.outputs.configured == 'true'
working-directory: onlyagent-cloud
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: npx wrangler deploy
Loading