From b94a19a8a3771ac516f7522c133fe837a278a804 Mon Sep 17 00:00:00 2001 From: support Date: Sun, 3 Mar 2024 19:44:01 +0100 Subject: [PATCH] Commit --- .../workflows/feature-tmp-test1_grandnode.yml | 51 ------------------- .github/workflows/grandnode.yml | 42 +++++++++++++++ 2 files changed, 42 insertions(+), 51 deletions(-) delete mode 100644 .github/workflows/feature-tmp-test1_grandnode.yml create mode 100644 .github/workflows/grandnode.yml diff --git a/.github/workflows/feature-tmp-test1_grandnode.yml b/.github/workflows/feature-tmp-test1_grandnode.yml deleted file mode 100644 index ca64c4607..000000000 --- a/.github/workflows/feature-tmp-test1_grandnode.yml +++ /dev/null @@ -1,51 +0,0 @@ -# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy -# More GitHub Actions for Azure: https://github.com/Azure/actions - -name: Build and deploy container app to Azure Web App - grandnode - -on: - push: - branches: - - feature/tmp-test1 - workflow_dispatch: - -jobs: - build: - runs-on: 'ubuntu-latest' - - steps: - - uses: actions/checkout@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Log in to registry - uses: docker/login-action@v2 - with: - registry: https://index.docker.io/v1/ - username: ${{ secrets.AzureAppService_ContainerUsername_40a046d79f6244f8bf6eba084df18e94 }} - password: ${{ secrets.AzureAppService_ContainerPassword_b8af5976b52c48c69124403aa0434a55 }} - - - name: Build and push container image to registry - uses: docker/build-push-action@v3 - with: - push: true - tags: index.docker.io/${{ secrets.AzureAppService_ContainerUsername_40a046d79f6244f8bf6eba084df18e94 }}/grandnode/grandnode2:${{ github.sha }} - file: ./Dockerfile - - deploy: - runs-on: ubuntu-latest - needs: build - environment: - name: 'production' - url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} - - steps: - - name: Deploy to Azure Web App - id: deploy-to-webapp - uses: azure/webapps-deploy@v2 - with: - app-name: 'grandnode' - slot-name: 'production' - publish-profile: ${{ secrets.AzureAppService_PublishProfile_293651c5710d44afa6e9aebcd4ff9403 }} - images: 'index.docker.io/${{ secrets.AzureAppService_ContainerUsername_40a046d79f6244f8bf6eba084df18e94 }}/grandnode/grandnode2:${{ github.sha }}' \ No newline at end of file diff --git a/.github/workflows/grandnode.yml b/.github/workflows/grandnode.yml new file mode 100644 index 000000000..f1508c71d --- /dev/null +++ b/.github/workflows/grandnode.yml @@ -0,0 +1,42 @@ +name: Build and deploy .NET Core app to Linux WebApp grandnode +on: + push: + branches: [ "feature/tmp-test1" ] + +env: + AZURE_WEBAPP_NAME: grandnode-dev + AZURE_WEBAPP_PACKAGE_PATH: src/Web/Grand.Web/publish + AZURE_WEBAPP_PUBLISH_PROFILE: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} + CONFIGURATION: Release + DOTNET_CORE_VERSION: 8.0.x + WORKING_DIRECTORY: src/Web/Grand.Web +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: ${{ env.DOTNET_CORE_VERSION }} + - name: Create mongoDB Docker container + run: sudo docker run -d -p 27017:27017 mongo:latest + - name: Restore + run: dotnet restore "${{ env.WORKING_DIRECTORY }}" + - name: Build sln + run: dotnet build "GrandNode.sln" + - name: Build + run: dotnet build "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-restore -p:SourceRevisionId=${{ github.sha }} -p:GitBranch=${{ github.ref_name }} + - name: Publish + run: dotnet publish "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-build --output "${{ env.AZURE_WEBAPP_PACKAGE_PATH }}" -p:SourceRevisionId=${{ github.sha }} -p:GitBranch=${{ github.ref_name }} + - name: Deploy to Azure WebApp + uses: azure/webapps-deploy@v2 + with: + app-name: ${{ env.AZURE_WEBAPP_NAME }} + package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} + publish-profile: ${{ env.AZURE_WEBAPP_PUBLISH_PROFILE }} + - name: Publish Artifacts + uses: actions/upload-artifact@v1.0.0 + with: + name: webapp + path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} \ No newline at end of file