diff --git a/.github/workflows/master_azcloudwebapps.yml b/.github/workflows/master_azcloudwebapps.yml new file mode 100644 index 00000000..dcb189be --- /dev/null +++ b/.github/workflows/master_azcloudwebapps.yml @@ -0,0 +1,39 @@ +# Docs for the Azure Web Apps Deploy action: https://go.microsoft.com/fwlink/?linkid=2134798 +# More GitHub Actions for Azure: https://go.microsoft.com/fwlink/?linkid=2135048 + +name: Azure App Service - azcloudwebapps(Production), Build and deploy DotnetCore app + +on: + push: + branches: + - master + +jobs: + build-and-deploy: + runs-on: windows-latest + + steps: + # checkout the repo + - name: 'Checkout Github Action' + uses: actions/checkout@master + + + - name: Set up .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '3.1.301' + + - name: Build with dotnet + run: dotnet build --configuration Release + + - name: dotnet publish + run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp + + - name: Run Azure webapp deploy action using publish profile credentials + uses: azure/webapps-deploy@v2 + with: + app-name: azcloudwebapps + slot-name: Production + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_DB50337956A7493FA51988ACB1661E8E }} + package: ${{env.DOTNET_ROOT}}/myapp + diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..0ec57a8c --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,39 @@ +# Docker +# Build and push an image to Azure Container Registry +# https://docs.microsoft.com/azure/devops/pipelines/languages/docker + +trigger: +- master + +resources: +- repo: self + +variables: + # Container registry service connection established during pipeline creation + dockerRegistryServiceConnection: '71da85f0-ce2d-42a8-8ab8-14b27f3b796d' + imageRepository: 'sufideenacrbuildhelloworldnode' + containerRegistry: 'azcloudarc.azurecr.io' + dockerfilePath: '$(Build.SourcesDirectory)/Dockerfile' + tag: '$(Build.BuildId)' + + # Agent VM image name + vmImageName: 'ubuntu-latest' + +stages: +- stage: Build + displayName: Build and push stage + jobs: + - job: Build + displayName: Build + pool: + vmImage: $(vmImageName) + steps: + - task: Docker@2 + displayName: Build and push an image to container registry + inputs: + command: buildAndPush + repository: $(imageRepository) + dockerfile: $(dockerfilePath) + containerRegistry: $(dockerRegistryServiceConnection) + tags: | + $(tag)