-
Notifications
You must be signed in to change notification settings - Fork 459
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
support
committed
Mar 3, 2024
1 parent
f785d2a
commit b94a19a
Showing
2 changed files
with
42 additions
and
51 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,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/[email protected] | ||
with: | ||
name: webapp | ||
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} |