Skip to content

DeployFrontendCloudflarePagesProd #136

DeployFrontendCloudflarePagesProd

DeployFrontendCloudflarePagesProd #136

name: DeployFrontendCloudflarePagesProd
on:
workflow_run:
workflows: ["DeployBackendProd"]
types:
- completed
branches:
- "master"
jobs:
deploy-frontend-prod:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- uses: actions/setup-node@v1
with:
node-version: "20"
- name: Install dependencies and Build the project
run: |
cd nuxt-frontend
sed -i "s|VITE_RECAPTCHA_SITE_KEY_VALUE|${{ secrets.RECAPTCHA_SITE_KEY }}|g" config.prod.js
sed -i "s|RESOURCES_URL|${{ secrets.RESOURCES_URL }}|g" config.prod.js
mv config.prod.js config.js
yarn install && yarn build
- name: Build & Deploy Worker
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: "nuxt-frontend"
command: pages deploy ./dist --project-name=canopas-website --branch=main