generated from codigofacilito/wth-devops
-
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.
- Loading branch information
1 parent
340b192
commit 79356f9
Showing
2 changed files
with
47 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Deploy to Azure | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- 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@v1 | ||
with: | ||
appSourcePath: ${{ github.workspace }} | ||
acrName: ${{ vars.AZURE_PREFIX }}acr | ||
resourceGroup: ${{ vars.AZURE_RG }} | ||
containerAppName: ${{ vars.AZURE_PREFIX }}containerapp | ||
containerAppEnvironment: ${{ vars.AZURE_PREFIX }}containerappenvironment |
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 |
---|---|---|
@@ -1,26 +1,24 @@ | ||
name: Deploy to Azure | ||
on: | ||
push: | ||
branches: | ||
- main | ||
name: Create Azure resources | ||
on: [workflow_dispatch] | ||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
# Checkout code | ||
- uses: actions/checkout@main | ||
|
||
- name: Log in to Azure | ||
uses: azure/login@v1 | ||
with: | ||
creds: ${{ secrets.AZURE_CREDENTIALS }} | ||
# Log into Azure | ||
- uses: azure/login@v1 | ||
with: | ||
creds: ${{ secrets.AZURE_CREDENTIALS }} | ||
|
||
- name: Build and deploy Container App | ||
uses: azure/container-apps-deploy-action@v1 | ||
with: | ||
appSourcePath: ${{ github.workspace }} | ||
acrName: ${{ vars.AZURE_PREFIX }}acr | ||
resourceGroup: ${{ vars.AZURE_RG }} | ||
containerAppName: ${{ vars.AZURE_PREFIX }}containerapp | ||
containerAppEnvironment: ${{ vars.AZURE_PREFIX }}containerappenvironment | ||
# Deploy Bicep file | ||
- name: create resources | ||
uses: azure/arm-deploy@v1 | ||
with: | ||
subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION }} | ||
resourceGroupName: ${{ vars.AZURE_RG }} | ||
template: ${{ github.workspace }}/config/main.bicep | ||
parameters: 'namePrefix=${{ vars.AZURE_PREFIX }}' | ||
failOnStdErr: false |