deploy-app-site #209
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy App Site to Cloudflare Pages | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
default: "main" | |
description: "branch" | |
type: string | |
repository_dispatch: | |
types: | |
- deploy-app-site | |
jobs: | |
deploy: | |
name: Deploy to Cloudfalre Pages | |
runs-on: ubuntu-latest | |
concurrency: build-app-site | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
repository: immersive-translate/site | |
ref: ${{github.event.inputs.branch || 'main'}} | |
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }} | |
# if branch not main | |
- if: ${{ github.event.inputs.branch && github.event.inputs.branch != 'main' }} | |
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: install website | |
run: npm i | |
- name: build app | |
run: make buildapp | |
- name: Publish Static to Cloudflare Pages | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.IMMERSIVE_CLOUDFLARE_API_TOKEN }} | |
accountId: ${{secrets.IMMERSIVE_CLOUDFLARE_ACCOUNT_ID}} | |
projectName: app-static | |
directory: app/static-dist | |
- name: Publish to Cloudflare Pages | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.IMMERSIVE_CLOUDFLARE_API_TOKEN }} | |
accountId: ${{secrets.IMMERSIVE_CLOUDFLARE_ACCOUNT_ID}} | |
projectName: app-v2 | |
directory: app/dist | |
# Optional: Enable this if you want to have GitHub Deployments triggered | |
# gitHubToken: ${{ secrets.GITHUB_TOKEN }} |