Skip to content
Merged
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
30 changes: 8 additions & 22 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
name: Deploy to GitHub Pages
name: Deploy to Cloudflare Pages

on:
push:
branches:
- main

permissions:
contents: read

jobs:
build-and-deploy:
name: Build Docusaurus and Storybook
name: Build and Deploy to Cloudflare Pages
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -35,24 +36,9 @@ jobs:
mkdir -p docs/build/storybook
cp -r bulma-ui/storybook-static/* docs/build/storybook/

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
path: docs/build

deploy:
name: Deploy to GitHub Pages
needs: build-and-deploy
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
outputs:
page_url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy docs/build --project-name=bestax --commit-dirty=true
35 changes: 31 additions & 4 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ on:
pull_request:
branches:
- main
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on

permissions:
contents: read
pull-requests: write

jobs:
test-deploy:
name: Test Docusaurus deployment
name: Test and Preview Deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -24,5 +24,32 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Test build website
- name: Build Docusaurus
run: npm run build -- --filter=@allxsmith/bestax-docs

- name: Build Storybook
run: npm run build-storybook -w bulma-ui

- name: Copy Storybook to Docusaurus build
run: |
mkdir -p docs/build/storybook
cp -r bulma-ui/storybook-static/* docs/build/storybook/

- name: Deploy Preview to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
id: deploy
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy docs/build --project-name=bestax --branch=${{ github.head_ref }} --commit-dirty=true

- name: Comment Preview URL
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '## Preview Deployment\n\nPreview URL: ${{ steps.deploy.outputs.deployment-url }}'
})
Comment on lines +46 to +55

Copilot AI Jan 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GitHub Actions expression inside the script block will not be interpolated correctly. The expression ${{ steps.deploy.outputs.deployment-url }} is within a single-quoted string in the script, which means it will be evaluated in the wrong context. You need to either use a multi-line script with proper escaping or pass the URL as an environment variable to the script block.

Copilot uses AI. Check for mistakes.
1 change: 0 additions & 1 deletion docs/static/CNAME

This file was deleted.

Loading