Skip to content

feat: add DesignDetail component with light/dark toggle and copy acti… #21

feat: add DesignDetail component with light/dark toggle and copy acti…

feat: add DesignDetail component with light/dark toggle and copy acti… #21

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches:
- main
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Validate designs
run: npm run validate:designs
- name: Build
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./dist
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Verify CORS headers
run: |
sleep 2
# Check both GitHub Pages and custom domain (which redirects to custom domain)
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -L https://luongnv89.github.io/sleek-ui/designs/editorial-dark.json)
if [ "$HTTP_CODE" -ne 200 ]; then
echo "CORS check failed: received HTTP $HTTP_CODE"
exit 1
fi
# Also verify CORS header is present
CORS_HEADER=$(curl -s -I -L https://luongnv89.github.io/sleek-ui/designs/editorial-dark.json | grep -i "access-control-allow-origin" || true)
if [ -z "$CORS_HEADER" ]; then
echo "CORS check failed: Access-Control-Allow-Origin header not found"
exit 1
fi
echo "CORS check passed: design files accessible with CORS headers"