-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update deploy script to include at21,23,24 (#64)
* Update deploy script to include at21,23,24 * added and updated deploy scripts --------- Co-authored-by: acn-dgopa <acn-dgopa@dev-acn-tje-14>
- Loading branch information
Showing
4 changed files
with
307 additions
and
5 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Deploy DotNet project to Azure Function App | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
type: environment | ||
description: Select the environment | ||
|
||
# CONFIGURATION | ||
# For help, go to https://github.com/Azure/Actions | ||
# | ||
# 1. Set up the following secrets in your repository: | ||
# AZURE_FUNCTIONAPP_PUBLISH_PROFILE | ||
# | ||
# 2. Change these variables for your configuration: | ||
env: | ||
AZURE_FUNCTIONAPP_PACKAGE_PATH: './src/Functions/Altinn.Auth.AuditLog.Functions' # set this to the path to your function app project, defaults to the repository root | ||
DOTNET_VERSION: '6.0.x' # set this to the dotnet version to use (e.g. '2.1.x', '3.1.x', '5.0.x') | ||
|
||
jobs: | ||
deploy-at21: | ||
runs-on: windows-latest | ||
environment: ${{ inputs.environment }} | ||
permissions: | ||
contents: read | ||
id-token: write | ||
steps: | ||
- name: 'Checkout GitHub Action' | ||
uses: actions/checkout@v3 | ||
|
||
- name: Azure Login | ||
uses: azure/login@v1 | ||
with: | ||
client-id: ${{ secrets.AZURE_CLIENT_ID }} | ||
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
|
||
- name: Setup DotNet ${{ env.DOTNET_VERSION }} Environment | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: ${{ env.DOTNET_VERSION }} | ||
|
||
- name: 'Resolve Project Dependencies Using Dotnet' | ||
shell: pwsh | ||
run: | | ||
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}' | ||
dotnet build --configuration Release --output ./output | ||
popd | ||
- name: 'Run Azure Functions Action' | ||
uses: Azure/functions-action@v1 | ||
id: fa | ||
with: | ||
app-name: ${{ vars.AZURE_FUNCTIONAPP_NAME }} | ||
package: '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Deploy to a specific environment | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
type: environment | ||
description: Select the environment | ||
version: | ||
type: string | ||
description: Enter the package version | ||
required: true | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: altinn/altinn-auth-audit-log | ||
CONTAINER_APP_CONTAINER_NAME: auditlog | ||
|
||
jobs: | ||
deploy: | ||
environment: ${{ inputs.environment }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
packages: read | ||
steps: | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Azure Login | ||
uses: azure/login@v1 | ||
with: | ||
client-id: ${{ secrets.AZURE_CLIENT_ID }} | ||
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
- name: Deploy to containerapp | ||
uses: azure/CLI@v1 | ||
with: | ||
inlineScript: > | ||
az config set extension.use_dynamic_install=yes_without_prompt | ||
az containerapp update \ | ||
--name ${{ vars.CONTAINER_APP_NAME }} \ | ||
--container-name ${{ env.CONTAINER_APP_CONTAINER_NAME }} \ | ||
--resource-group ${{ vars.CONTAINER_APP_RESOURCE_GROUP_NAME }} \ | ||
--image ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.version }} | ||
- name: logout | ||
run: > | ||
az logout |