0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

ci: release cloud prod (#3351)

This commit is contained in:
Gao Sun 2023-03-10 16:13:09 +08:00 committed by GitHub
parent 394637f200
commit 6c4a9c336f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 10 deletions

View file

@ -2,6 +2,15 @@ name: Release Cloud
on:
workflow_dispatch:
inputs:
target:
description: 'The release target of Logto Cloud'
required: true
default: cloud
type: choice
options:
- cloud
push:
branches:
- master
@ -11,7 +20,6 @@ concurrency:
jobs:
dockerize:
environment: ${{ startsWith(github.ref, 'refs/tags/') && 'release' || '' }}
runs-on: ubuntu-latest
steps:
@ -25,9 +33,9 @@ jobs:
with:
images: |
ghcr.io/logto-io/cloud
# https://github.com/docker/metadata-action#typesemver
# https://github.com/docker/metadata-action
tags: |
type=edge
type=raw,value=${{ inputs.target == 'cloud' && 'prod' || 'edge' }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
@ -47,12 +55,13 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args:
- admin_endpoint: https://auth.logto.${{ inputs.target == 'cloud' && 'io' || 'dev' }}/
deploy-dev:
deploy:
runs-on: ubuntu-latest
needs: dockerize
environment: cloud-dev
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
environment: ${{ inputs.target == 'cloud' && 'cloud-prod' || 'cloud-dev' }}
steps:
- name: Login to GitHub Container Registry
@ -70,5 +79,5 @@ jobs:
- name: Deploy to containerapp
uses: azure/webapps-deploy@v2
with:
app-name: logto-cloud-dev
images: ghcr.io/logto-io/cloud:edge
app-name: logto-cloud-${{ inputs.target == 'cloud' && 'eu' || 'dev' }}
images: ghcr.io/logto-io/cloud:${{ inputs.target == 'cloud' && 'prod' || 'edge' }}

View file

@ -21,8 +21,8 @@ RUN pnpm i
# Admin Console build env
ENV CONSOLE_PUBLIC_URL=/
ENV IS_CLOUD=1
# Temporarily use it for Admin Console build, will try to use runtime technique later
ENV ADMIN_ENDPOINT=https://auth.logto.dev/
ARG admin_endpoint
ENV ADMIN_ENDPOINT=${admin_endpoint}
RUN pnpm prepack
RUN pnpm -r --filter @logto/console --filter @logto/cloud build