Skip to content

deploy-develop-official-site #486

deploy-develop-official-site

deploy-develop-official-site #486

name: Deploy Develop Official Site to Cloudflare Pages
on:
workflow_dispatch:
inputs:
branch:
default: "develop"
description: "branch"
type: string
repository_dispatch:
types:
- deploy-develop-official-site
jobs:
deploy:
name: Deploy to Cloudfalre Pages
runs-on: ubuntu-latest
concurrency: build-dev-offical-site
steps:
- uses: actions/checkout@v3
with:
repository: immersive-translate/site
ref: ${{github.event.inputs.branch || 'develop'}}
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
- run: git checkout -b main
- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
cache-dependency-path: ./package-lock.json
- name: Build website
run: npm i && cd official && npm run build:develop
- name: Deploy worker
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.IMMERSIVE_CLOUDFLARE_API_TOKEN }}
accountId: ${{secrets.IMMERSIVE_CLOUDFLARE_ACCOUNT_ID}}
workingDirectory: ./account-shared
command: deploy worker.js
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.IMMERSIVE_CLOUDFLARE_API_TOKEN }}
accountId: ${{secrets.IMMERSIVE_CLOUDFLARE_ACCOUNT_ID}}
projectName: develop-immersivetranslate
directory: official/build
# Optional: Enable this if you want to have GitHub Deployments triggered
# gitHubToken: ${{ secrets.GITHUB_TOKEN }}