chore: add cicd for jan web prod
This commit is contained in:
parent
5e30e10bf4
commit
4372c22364
53
.github/workflows/jan-server-web-cicd-prod.yml
vendored
Normal file
53
.github/workflows/jan-server-web-cicd-prod.yml
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
name: Jan Web Server deploy to production
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v[0-9]+.[0-9]+.[0-9]+-web"]
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
deployments: write
|
||||
pull-requests: write
|
||||
env:
|
||||
JAN_API_BASE: "https://api.jan.ai"
|
||||
CLOUDFLARE_PROJECT_NAME: "jan-server-web"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install jq
|
||||
uses: dcarbone/install-jq-action@v2.0.1
|
||||
|
||||
# - name: Fill env vars
|
||||
# run: |
|
||||
# env_example_file=".env.example"
|
||||
# touch .env
|
||||
# while IFS= read -r line || [[ -n "$line" ]]; do
|
||||
# if [[ "$line" == *"="* ]]; then
|
||||
# var_name=$(echo $line | cut -d '=' -f 1)
|
||||
# echo $var_name
|
||||
# var_value="$(jq -r --arg key "$var_name" '.[$key]' <<< "$SECRETS")"
|
||||
# echo "$var_name=$var_value" >> .env
|
||||
# fi
|
||||
# done < "$env_example_file"
|
||||
# env:
|
||||
# SECRETS: '${{ toJson(secrets) }}'
|
||||
|
||||
- name: Install dependencies
|
||||
run: make config-yarn && yarn install && yarn build:core && make build-web-app
|
||||
|
||||
- name: Publish to Cloudflare Pages Production
|
||||
uses: cloudflare/pages-action@v1
|
||||
with:
|
||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
projectName: ${{ env.CLOUDFLARE_PROJECT_NAME }}
|
||||
directory: ./web-app/dist-web
|
||||
branch: main
|
||||
# Optional: Enable this if you want to have GitHub Deployments triggered
|
||||
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
Loading…
x
Reference in New Issue
Block a user