Skip to content

Commit

Permalink
Update main_mango-entertainment-api.yml
Browse files Browse the repository at this point in the history
Deploy main branch
  • Loading branch information
ssmodish authored Jul 26, 2024
1 parent fff8216 commit a80b187
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions .github/workflows/main_mango-entertainment-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ on:
- main
workflow_dispatch:

env:
AZURE_WEBAPP_NAME: mango-entertainment-api
DOTNET_VERSION: '8.x'
WORKING_DIRECTORY: ./base-api

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -19,38 +24,44 @@ jobs:
- name: Set up .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Restore Dependencies
run: dotnet restore
working-directory: ${{ env.WORKING_DIRECTORY }}

- name: Build with dotnet
run: dotnet build --configuration Release
run: dotnet build --configuration Release --no-restore
working-directory: ${{ env.WORKING_DIRECTORY }}

- name: dotnet publish
run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp
- name: Publish
run: dotnet publish -c Release -o ${{github.workspace}}/publish
working-directory: ${{ env.WORKING_DIRECTORY }}

- name: Upload artifact for deployment job
uses: actions/upload-artifact@v4
with:
name: .net-app
path: ${{env.DOTNET_ROOT}}/myapp
path: ${{github.workspace}}/publish

deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
- name: Download artifact from build job
uses: actions/download-artifact@v4
with:
name: .net-app

- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v3
with:
app-name: 'mango-entertainment-api'
app-name: ${{ env.AZURE_WEBAPP_NAME }}
slot-name: 'Production'
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_1140C5145B254A12A68F8D7CAFFB1095 }}
package: .
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_EC08CC2ACD434CBA99B6F674652AC35B }}

0 comments on commit a80b187

Please sign in to comment.