Skip to content

Commit

Permalink
Document in Technical.md: "How the API backend action workflow was cr…
Browse files Browse the repository at this point in the history
…eated"
  • Loading branch information
Konrad Jamrozik committed Dec 21, 2023
1 parent 2230775 commit 7b1b1f0
Showing 1 changed file with 38 additions and 7 deletions.
45 changes: 38 additions & 7 deletions docs/Technical.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,29 @@

## How the API backend action workflow was created

The backend API deployment configuration is a GitHub Action workflow [.github/workflows/api-game-lib.yml](.github/workflows/api-game-lib.yml)
which was initially created (see [git history](https://github.com/konrad-jamrozik/game/commits/main/.github/workflows/api-game-lib.yml))
by following these instructions:
The backend API deployment configuration is a GitHub Action workflow [.github/workflows/main_api-game-lib.yml](.github/workflows/main_api-game-lib.yml).

I have initially created it using [api-game-lib Deployment Center] per the [Continuous deployment to Azure App Service]
article. Once I clicked the relevant button in Azure portal, it has pushed
[this commit][commit with API GHAW from Depl Center].
The file was not yet working correctly, though, and I had to fix it by making [this commit][commit with API GHAW fix].

Having the GitHub action workflow created from the deployment center shows that it is connected to GitHub, in `Settings`
pane in the [Deployment Center Azure view][api-game-lib Deployment Center]. There are also few other benefits, like
logs being synced from the GitHub runner logs to the center, as explained in [the FAQ][Azure App Service CD FAQ].

Note that previously I had another GitHub action workflow for deploying the API, the `api-game-lib.yml`.
Per [its history][api-game-lib.yml git history], at first I created it by following:

- [Tutorial: Create a minimal API with ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/tutorials/min-web-api?view=aspnetcore-8.0&tabs=visual-studio)
- [Quickstart: Deploy an ASP.NET web app](https://learn.microsoft.com/en-us/azure/app-service/quickstart-dotnetcore?tabs=net70&pivots=development-environment-vs)
- [Tutorial: Create a minimal API with ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/tutorials/min-web-api?view=aspnetcore-8.0&tabs=visual-studio), to create the stub API.
- [Quickstart: Deploy an ASP.NET web app](https://learn.microsoft.com/en-us/azure/app-service/quickstart-dotnetcore?tabs=net70&pivots=development-environment-vs), to deploy the API to Azure.

However, it appears to be obsolete. I created it in August 2023, but I was unable to reproduce it in December 2023.
Overall, the story for creating GitHub actions workflow for ASP.NET Core .NET Web App is messy, as I documented here:

- [The documentation about creating GitHub Actions workflow for CI/CD for .NET Core Azure Web App needs consolidation #118243](https://github.com/MicrosoftDocs/azure-docs/issues/118243).

When deleting `api-game-lib.yml`, I also removed its secret from [GitHub actions secrets], `API_GAME_LIB_65C2`.

## How the web fronted GitHub action workflow was created

Expand All @@ -20,8 +37,22 @@ by following these instructions:

Specifically, I used the [Azure Static Web Apps VS Code extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurestaticwebapps)
wizard to configure the deployment, per `Vite / Deploying a Static Site / Azure Static Web Apps`:
> Follow the wizard started by the extension to give your app a name, choose a framework preset,
> and designate the app root (usually /) and built file location /dist. The wizard will run and will
> Follow the wizard started by the extension to give your app a name, choose a framework preset,
> and designate the app root (usually /) and built file location /dist. The wizard will run and will
> create a GitHub action in your repo in a .github folder.
This created the GitHub Action workflow, which looks like the [Build configuration here](https://learn.microsoft.com/en-us/azure/static-web-apps/build-configuration?tabs=github-actions#build-configuration).

<!--
--------------------------------------------------------------------------------
references
--------------------------------------------------------------------------------
-->

[api-game-lib Deployment Center]: https://portal.azure.com/#@spawarottijamro.onmicrosoft.com/resource/subscriptions/8695c84c-09a4-4b50-994f-a2fa7f36cc92/resourceGroups/game-web/providers/Microsoft.Web/sites/api-game-lib/vstscd
[Continuous deployment to Azure App Service]: https://learn.microsoft.com/en-us/azure/app-service/deploy-continuous-deployment?tabs=github
[Azure App Service CD FAQ]: https://learn.microsoft.com/en-us/azure/app-service/deploy-continuous-deployment?tabs=github#frequently-asked-questions
[commit with API GHAW from Depl Center]: https://github.com/konrad-jamrozik/game/commit/9f1f5143aab4953ffc821fda2b0f18cb9825dc18
[commit with API GHAW fix]: https://github.com/konrad-jamrozik/game/commit/463e9e74ef2b89cbb2ef1755b0bfb830208722f4
[api-game-lib.yml git history]: https://github.com/konrad-jamrozik/game/commits/main/.github/workflows/api-game-lib.yml
[GitHub actions secrets]: https://github.com/konrad-jamrozik/game/settings/secrets/actions

0 comments on commit 7b1b1f0

Please sign in to comment.