-
Notifications
You must be signed in to change notification settings - Fork 223
User/vchintalapat/GitHub actions test #443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
6c9b1a3
Github actions test
Saipriya-1144 ec18e7f
Github actions test
Saipriya-1144 abaac2e
Create githubactionstest
Saipriya-1144 588b05b
modified github actions test
Saipriya-1144 3f2aea3
copied github_actions_test to other workflow for testsing
Saipriya-1144 8751410
modified helloController to trigger workflow
Saipriya-1144 51e9216
added a github action workflow
Saipriya-1144 5d297e0
removed sln file
Saipriya-1144 1593b78
modified defaultlabels.yml
Saipriya-1144 0d666eb
added node sample app
Saipriya-1144 79292b3
copied this code to defaultLabels.yml for testing
Saipriya-1144 06cc512
copied this code to defaultLabels.yml for testing
Saipriya-1144 7fe2efa
modified github_actions_test workflow
Saipriya-1144 19ad66c
modified node sample app
Saipriya-1144 13b3c55
modified node app name
Saipriya-1144 8308b2c
modified node app server.js
Saipriya-1144 5254800
modified site name for this node app
Saipriya-1144 f52d595
modified server.js in sample node app
Saipriya-1144 2467ad1
modified server.js in sample node app
Saipriya-1144 19d66c3
modified server.js in sample node app
Saipriya-1144 d337a21
modified github_actions_test.yml
Saipriya-1144 9adeea5
added new workflow to prebuild and deploy the app
Saipriya-1144 fa413bb
removed unnecessary workflows
Saipriya-1144 ceb4c06
modified ci.yml
Saipriya-1144 fe7f03b
pushed to defaultlabels.yml to trigger workflow
Saipriya-1144 afc95b5
modified github actions workflow
Saipriya-1144 cc54675
updated HelloController.cs
Saipriya-1144 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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,111 @@ | ||
| # 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 to Azure App Services | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| schedule: | ||
| - cron: "0 0/3 * * *" | ||
|
|
||
| jobs: | ||
| build-and-deploy-dotnet-app: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| permissions: | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Modify the sample app | ||
| run: | | ||
| cp -r ./__tests__/dotnetsampleapp dotnetapp | ||
| current_utc_time=$(date -u +"%Y-%m-%d %H:%M:%S %Z") | ||
| sed -i "s/<<<net-place-holder>>>/$current_utc_time/g" dotnetapp/Controllers/HelloController.cs | ||
|
|
||
| echo "The placeholder has been replaced with current UTC time: $current_utc_time" | ||
|
|
||
| - name: Set up .NET Core | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: '8.x' | ||
|
|
||
| - name: Build with dotnet | ||
| run: dotnet build --configuration Release dotnetapp/DOTNET_8_APP.csproj | ||
|
|
||
| - name: dotnet publish | ||
| run: dotnet publish dotnetapp/DOTNET_8_APP.csproj -c Release -o myapp | ||
|
|
||
| - name: Upload artifact for deployment job | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: .net-app | ||
| path: myapp | ||
|
|
||
| - name: Login to Azure | ||
| uses: azure/login@v2 | ||
| with: | ||
| client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_DOTNETAPP1 }} | ||
| tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID }} | ||
| subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID }} | ||
|
|
||
| - name: Deploy to Azure Web App | ||
| id: deploy-to-webapp | ||
| uses: azure/webapps-deploy@v3 | ||
| with: | ||
| app-name: 'lwasv2-euap-dotnet-githubactionstest' | ||
| slot-name: 'Production' | ||
| package: myapp | ||
|
|
||
| build-and-deploy-node-app: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| permissions: | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: modify Node.js App | ||
| run: | | ||
| cp -r ./__tests__/nodesampleapp nodeapp | ||
| current_utc_time=$(date -u +"%Y-%m-%d %H:%M:%S %Z") | ||
| sed -i "s/<<<node-place-holder>>>/$current_utc_time/g" nodeapp/server.js | ||
|
|
||
| echo "The placeholder has been replaced with current UTC time: $current_utc_time" | ||
|
|
||
| - name: Set up Node.js version | ||
| uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: '18.x' | ||
|
|
||
| - name: npm install, build, and test | ||
| run: | | ||
| cd nodeapp | ||
| npm install | ||
| npm run build --if-present | ||
| npm run test --if-present | ||
|
|
||
| - name: Upload artifact for deployment job | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: node-app | ||
| path: nodeapp | ||
|
|
||
| - name: Login to Azure | ||
| uses: azure/login@v2 | ||
| with: | ||
| client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_NODEAPP1 }} | ||
| tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID }} | ||
| subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID }} | ||
|
|
||
| - name: 'Deploy to Azure Web App' | ||
| id: deploy-to-webapp | ||
| uses: azure/webapps-deploy@v3 | ||
| with: | ||
| app-name: 'lwasv2-euap-node-githubactions' | ||
| slot-name: 'Production' | ||
| package: nodeapp | ||
This file contains hidden or 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 @@ | ||
| using Microsoft.AspNetCore.Mvc; | ||
|
|
||
| namespace DOTNET_8_APP.Controllers | ||
| { | ||
| [ApiController] | ||
| public class HelloController : Controller | ||
| { | ||
| private readonly ILogger<HelloController> _logger; | ||
| private const string dummyAppSetting = "DUMMY_APPSETTING"; | ||
|
|
||
| public HelloController(ILogger<HelloController> logger) | ||
| { | ||
| _logger = logger; | ||
| } | ||
|
|
||
| [HttpGet] | ||
| [Route("/")] | ||
| public string Hello() | ||
| { | ||
| Console.WriteLine("Hello endpoint called!"); | ||
| return "Hello from .NET 8 App "; | ||
| } | ||
|
|
||
| [HttpGet] | ||
| [Route("/dummy")] | ||
| public string DummyAppsetting() | ||
| { | ||
| Console.WriteLine("Dummy endpoint called!!"); | ||
| var dummyAppSettingValue = Environment.GetEnvironmentVariable(dummyAppSetting); | ||
| if (dummyAppSettingValue != null) { return dummyAppSettingValue; } | ||
| return "Appsetting not found!"; | ||
| } | ||
|
|
||
| [HttpGet] | ||
| [Route("/placeholder")] | ||
| public string PlaceHolder() | ||
| { | ||
| Console.WriteLine("Placeholder endpoint called!!"); | ||
| return "<<<net-place-holder>>>"; | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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,15 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <Nullable>enable</Nullable> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <InvariantGlobalization>true</InvariantGlobalization> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.0-preview.7.23375.9" /> | ||
| <PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
This file contains hidden or 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,23 @@ | ||
| var builder = WebApplication.CreateBuilder(args); | ||
|
|
||
| // Add services to the container. | ||
|
|
||
| builder.Services.AddControllers(); | ||
| // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle | ||
| builder.Services.AddEndpointsApiExplorer(); | ||
| builder.Services.AddSwaggerGen(); | ||
|
|
||
| var app = builder.Build(); | ||
|
|
||
| // Configure the HTTP request pipeline. | ||
| if (app.Environment.IsDevelopment()) | ||
| { | ||
| app.UseSwagger(); | ||
| app.UseSwaggerUI(); | ||
| } | ||
|
|
||
| app.UseAuthorization(); | ||
|
|
||
| app.MapControllers(); | ||
|
|
||
| app.Run(); |
This file contains hidden or 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,8 @@ | ||
| { | ||
| "Logging": { | ||
| "LogLevel": { | ||
| "Default": "Information", | ||
| "Microsoft.AspNetCore": "Warning" | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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,9 @@ | ||
| { | ||
| "Logging": { | ||
| "LogLevel": { | ||
| "Default": "Information", | ||
| "Microsoft.AspNetCore": "Warning" | ||
| } | ||
| }, | ||
| "AllowedHosts": "*" | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.