Skip to content

Add Lerna

Add Lerna #46

Workflow file for this run

name: Deploy Staging
on:
push:
concurrency:
group: "cloudflare-pages-staging"
cancel-in-progress: false
jobs:
build-website:
name: Build Website
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: latest
cache: npm
- name: Install Packages
run: npm ci
shell: bash
- name: Build Packages
run: npm run build:packages
shell: bash
- name: Build
run: npx lerna run build --scope=@dot-tutor/website
shell: bash
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: website-staging
path: website/dist
deploy-website:
name: Deploy to Cloudflare Pages
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
needs: build-website
steps:
- name: Dowload Artifact
uses: actions/download-artifact@v4
with:
name: website-staging
path: website/dist
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: dot-tutor-website-staging
directory: dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
workingDirectory: website
wranglerVersion: "3"
build-learn:
name: Build Learn
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: latest
cache: npm
- name: Install Packages
run: npm ci
shell: bash
- name: Build Packages
run: npm run build:packages
shell: bash
- name: Build
run: npx lerna run build --scope=@dot-tutor/learn
shell: bash
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: learn-staging
path: learn/out
deploy-learn:
name: Deploy to Cloudflare Pages
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
needs: build-learn
steps:
- name: Dowload Artifact
uses: actions/download-artifact@v4
with:
name: learn-staging
path: learn/out
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: dot-tutor-learn-staging
directory: out
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
workingDirectory: learn
wranglerVersion: "3"
build-translate:
name: Build Translate
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: latest
cache: npm
- name: Install Packages
run: npm ci
shell: bash
- name: Build Packages
run: npm run build:packages
shell: bash
- name: Build
run: npx lerna run build --scope=@dot-tutor/translate
shell: bash
env:
VITE_API_ENDPOINT: "https://dot-tutor-backend.onrender.com"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: translate-staging
path: translate/dist
deploy-translate:
name: Deploy to Cloudflare Pages
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
needs: build-translate
steps:
- name: Dowload Artifact
uses: actions/download-artifact@v4
with:
name: translate-staging
path: translate/dist
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: dot-tutor-translate-staging
directory: dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
workingDirectory: translate
wranglerVersion: "3"