-
Notifications
You must be signed in to change notification settings - Fork 6
56 lines (51 loc) · 1.83 KB
/
Copy pathapi-publish-shared.yml
File metadata and controls
56 lines (51 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: shared workflow to publish an API with dotnet publish
on:
workflow_call:
inputs:
containerimage-name:
required: true
type: string
app-name:
required: true
type: string
registryname:
required: true
type: string
registryserver:
required: true
type: string
resource-group:
required: true
type: string
secrets:
CODEBREAKERAPI_AZURE_CREDENTIALS:
required: true
REGISTRY_USERNAME:
required: true
REGISTRY_PASSWORD:
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.CODEBREAKERAPI_AZURE_CREDENTIALS }}
- name: Deploy to containerapp
uses: azure/CLI@v1
with:
inlinescript: |
echo "installing containerapp extension"
az config set extension.use_dynamic_install=yes_without_prompt
echo "Starting deploying."
az containerapp registry set -n ${{ inputs.app-name }} -g ${{ inputs.resource-group }} --server ${{ inputs.registryname }} --username ${{ secrets.REGISTRY_USERNAME }} --password ${{ secrets.REGISTRY_PASSWORD }}
az containerapp update -n ${{ inputs.app-name }} -g ${{ inputs.resource-group }} --image ${{ inputs.registryserver }}/${{ inputs.containerimage-name }}:latest
# ContainerApp authenticates using a managed identity
# - name: Deploy Container App
# uses: azure/container-apps-deploy-action@v0
# with:
# acrName: ${{ inputs.registry }}
# containerAppName: ${{ inputs.app-name }}
# resourceGroup: ${{ inputs.resource-group }}
# imageToDeploy: ${{ inputs.registry }}/${{ inputs.containerimage-name }}:${{ github.sha }}