Skip to content

Deploy Demo

Deploy Demo #8

Workflow file for this run

name: Deploy Demo
on:
workflow_dispatch:
workflow_run:
workflows: ["Publish"]
types: [completed]
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get version from package.json
id: version
run: echo "VERSION=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
- name: Update image tag
run: |
sed -i "s|pgplex/pgconsole:[^ \"]*|pgplex/pgconsole:${{ steps.version.outputs.VERSION }}|" worker/demo/wrangler.toml
sed -i "s|pgplex/pgconsole:[^ \"]*|pgplex/pgconsole:${{ steps.version.outputs.VERSION }}|" worker/demo/src/index.ts
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install dependencies
run: pnpm install --frozen-lockfile
working-directory: worker/demo
- name: Deploy to Cloudflare
run: pnpm wrangler deploy
working-directory: worker/demo
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}