mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 08:45:38 +02:00
🐜 fix(ci): Fix issue where main does not deploy to prod (#216)
## Description Fix an issue where the `apps/www` CI does not push to main ## Related Issues <!-- List any related issues (e.g., "Closes #123", "Fixes #456") --> ## Type of Change - [x] Bug fix (non-breaking change) - [ ] New feature (non-breaking change) - [ ] Breaking change (fix or feature that changes existing functionality) - [ ] Documentation update - [ ] Other (please describe): ## Checklist - [ ] I have updated relevant documentation - [ ] My code follows the project's coding style - [ ] My changes generate no new warnings/errors ## Notes for Reviewers <!-- Point out areas you'd like reviewers to focus on, questions you have, or decisions that need discussion --> ## Screenshots/Demo <!-- If applicable, add screenshots or a GIF demo of your changes (especially for UI changes) --> ## Additional Context <!-- Add any other context about the pull request here -->
This commit is contained in:
33
.github/workflows/www.yml
vendored
33
.github/workflows/www.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: Build apps/www
|
name: Build www
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
@@ -12,8 +12,10 @@ on:
|
|||||||
- ".github/workflows/www.yml"
|
- ".github/workflows/www.yml"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy-www-pr:
|
||||||
|
name: Build www on PR
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: "apps/www"
|
working-directory: "apps/www"
|
||||||
@@ -35,6 +37,33 @@ jobs:
|
|||||||
wranglerVersion: "3.93.0"
|
wranglerVersion: "3.93.0"
|
||||||
workingDirectory: "apps/www"
|
workingDirectory: "apps/www"
|
||||||
command: pages deploy ./dist --project-name=${{ vars.CF_WWW_PAGES_PROJECT_NAME }} --commit-dirty=true
|
command: pages deploy ./dist --project-name=${{ vars.CF_WWW_PAGES_PROJECT_NAME }} --commit-dirty=true
|
||||||
|
env:
|
||||||
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||||
|
|
||||||
|
deploy-www-main:
|
||||||
|
name: Build www on main
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.ref == 'refs/heads/main' }}
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: "apps/www"
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: oven-sh/setup-bun@v1
|
||||||
|
with:
|
||||||
|
bun-version: latest
|
||||||
|
- name: Install dependencies
|
||||||
|
run: bun install
|
||||||
|
- name: Build Project Artifacts
|
||||||
|
run: bun run build
|
||||||
|
- name: Deploy Project Artifacts to Cloudflare
|
||||||
|
uses: cloudflare/wrangler-action@v3
|
||||||
|
with:
|
||||||
|
packageManager: bun
|
||||||
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||||
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||||
|
wranglerVersion: "3.93.0"
|
||||||
|
workingDirectory: "apps/www"
|
||||||
|
command: pages deploy ./dist --project-name=${{ vars.CF_WWW_PAGES_PROJECT_NAME }} --commit-dirty=true --branch=main
|
||||||
env:
|
env:
|
||||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||||
Reference in New Issue
Block a user