0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-20 21:32:31 -05:00
logto/.github/workflows/release-cloud.yml
2023-03-06 15:05:35 +00:00

74 lines
1.8 KiB
YAML

name: Release Cloud
on:
workflow_dispatch:
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
jobs:
dockerize:
environment: ${{ startsWith(github.ref, 'refs/tags/') && 'release' || '' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/logto-io/cloud
# https://github.com/docker/metadata-action#typesemver
tags: |
type=edge
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: silverhand-bot
password: ${{ secrets.BOT_PAT }}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push
uses: docker/build-push-action@v4
with:
file: Dockerfile.cloud
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
deploy-dev:
runs-on: ubuntu-latest
needs: dockerize
environment: cloud-dev
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: silverhand-bot
password: ${{ secrets.BOT_PAT }}
- name: Login via Azure CLI
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Deploy to containerapp
uses: azure/webapps-deploy@v2
with:
app-name: logto-cloud-dev
images: ghcr.io/logto-io/cloud:edge