Skip to content

Update Dockerfile

Update Dockerfile #28

on:
push:
branches:
- main
env:
DOTNET_CORE_VERSION: 8.0.x
CONTAINER_APP_NAME: projectxgatewayapi-container-app
CONTAINER_APP_ENVIRONMENT_NAME: managedEnv20231128015747
RESOURCE_GROUP: managedEnv20231128015747ResourceGroup
CONTAINER_REGISTRY_NAME: registry20231128020059
CONTAINER_REGISTRY_LOGIN_SERVER: registry20231128020059.azurecr.io
jobs:
BuildAndDeployContainerApp:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_CORE_VERSION }}
- name: "CMake native libs"
run: |
cmake -S ./ProjectX.AnalyticsLibNative -B ./ProjectX.AnalyticsLibNative/out -DCMAKE_INSTALL_PREFIX=./ProjectX.AnalyticsLibNative/out/install/linux-base
cmake --build ./ProjectX.AnalyticsLibNative/out
- run: ls ./ProjectX.AnalyticsLibNative/out/bin
- run: cp ./ProjectX.AnalyticsLibNative/out/bin/ProjectX.AnalyticsLibNative.so ./3rdParty
- run: ls ./3rdParty
- name: "Build sln"
run: |
dotnet restore ProjectX_.sln
dotnet build ProjectX_.sln -c Release
- name: "Run tests"
run: dotnet test ProjectX_.sln -c Release
- name: Azure login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Container App deploy
uses: azure/container-apps-deploy-action@v1
with:
appSourcePath: ${{ github.workspace }}/ProjectX.GatewayAPI
acrName: ${{ env.CONTAINER_REGISTRY_NAME }}
acrUsername: ${{ secrets.registry20231128020059_USERNAME_74CC }}
acrPassword: ${{ secrets.registry20231128020059_PASSWORD_74CC }}
imageToBuild: ${{ env.CONTAINER_REGISTRY_LOGIN_SERVER }}/${{ env.CONTAINER_APP_NAME }}:${{ github.sha }}
containerAppName: ${{ env.CONTAINER_APP_NAME }}
containerAppEnvironment: ${{ env.CONTAINER_APP_ENVIRONMENT_NAME }}
resourceGroup: ${{ env.RESOURCE_GROUP }}