chore: Update pipelines; fixed api docker #23
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 Platform | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- develop | |
paths: | |
[ | |
'apps/platform/**', | |
'.github/workflows/deploy-platform.yml', | |
'package.json' | |
] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: ${{ github.ref == 'refs/heads/main' && 'alpha' || 'stage' }} | |
name: Build and push Platform docker image for release | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Docker Login | |
uses: azure/docker-login@v2 | |
with: | |
login-server: ${{ vars.ACR_REGISTRY_URL }} | |
username: ${{ secrets.ACR_USERNAME }} | |
password: ${{ secrets.ACR_PASSWORD }} | |
- name: Build Docker image | |
id: build | |
env: | |
ACR_REGISTRY_URL: ${{ vars.ACR_REGISTRY_URL }} | |
REPOSITORY_NAME: platform | |
run: | | |
# Build a docker container and push it to ACR | |
docker build -t $ACR_REGISTRY_URL/$REPOSITORY_NAME:${GITHUB_SHA::6} -t $ACR_REGISTRY_URL/$REPOSITORY_NAME:latest -f ./apps/platform/Dockerfile . | |
echo "Pushing image to ACR..." | |
docker push $ACR_REGISTRY_URL/$REPOSITORY_NAME:latest | |
docker push $ACR_REGISTRY_URL/$REPOSITORY_NAME:${GITHUB_SHA::6} | |
echo "name=image::$ACR_REGISTRY_URL/$REPOSITORY_NAME:latest" >> $GITHUB_OUTPUT | |
# deploy: | |
# runs-on: ubuntu-latest | |
# environment: ${{ github.ref == 'refs/heads/main' && 'alpha' || 'stage' }} | |
# name: Restart Platform container app | |
# needs: build | |
# steps: | |
# - name: Azure Login action | |
# uses: azure/login@v2 | |
# with: | |
# creds: ${{ secrets.CONTAINER_APP_SP_CREDENTIALS }} | |
# enable-AzPSSession: true | |
# - name: Azure CLI script | |
# uses: azure/cli@v2 | |
# env: | |
# PLATFORM_CONTAINER: ${{ vars.PLATFORM_CONTAINER }} | |
# PLATFORM_CONTAINER_RG: ${{ vars.PLATFORM_CONTAINER_RG }} | |
# with: | |
# azcliversion: latest | |
# inlineScript: | | |
# az containerapp restart --name $PLATFORM_CONTAINER --resource-group $PLATFORM_CONTAINER_RG |