Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Update server-deploy.yml #44

Update server-deploy.yml

Update server-deploy.yml #44

Workflow file for this run

name: If push to the main, deploy it
on:
workflow_dispatch:
push:
branches:
- main
# paths:
# - "canbus-server/**"
jobs:
build:
runs-on: ubuntu-latest
env:
APP_NAME: ${{ secrets.SERVICE_NAME }}-server
APP_ENV: ${{ secrets.SERVICE_NAME }}-server-env
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Make Env File
run: |
touch canbus-server/.env
echo "${{ secrets.ENV_FILE }}" >> canbus-server/.env
- name: Log in to Azure
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Build and deploy Container App
uses: azure/container-apps-deploy-action@v0
with:
appSourcePath: ${{ github.workspace }}/${{ env.APP_NAME }}
acrName: ${{ secrets.ACR_NAME }}
acrUsername: ${{ secrets.ACR_USERNAME }}
acrPassword: ${{ secrets.ACR_PASSWORD }}
containerAppName: ${{ env.APP_NAME }}
containerAppEnvironment: ${{ env.APP_ENV }}
resourceGroup: ${{ secrets.RG_NAME }}
imageToBuild: ${{ secrets.ACR_NAME }}.azurecr.io/${{ env.APP_NAME }}:${{ github.sha }}
dockerfilePath: Dockerfile
- name: Azure Container Apps Ingress Setting
run: az containerapp ingress update --name ${{ env.APP_NAME }} --resource-group ${{ secrets.RG_NAME }} --target-port 8080 --allow-insecure