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

View file

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