{"id":31777957,"url":"https://github.com/blaze6950/githubactionssample","last_synced_at":"2026-04-29T22:41:05.214Z","repository":{"id":312182828,"uuid":"543087984","full_name":"blaze6950/GitHubActionsSample","owner":"blaze6950","description":"An example solution with api \u0026 NuGet package which shows the part of GitHub workflows functionality","archived":false,"fork":false,"pushed_at":"2022-11-09T16:40:01.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-29T05:39:31.650Z","etag":null,"topics":["asp-net","asp-net-core","c-sharp","docker-image","github-actions","github-packages","github-workflow","nuget-package","workflow"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blaze6950.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-09-29T11:36:39.000Z","updated_at":"2022-10-01T21:49:44.000Z","dependencies_parsed_at":"2025-08-29T05:39:37.208Z","dependency_job_id":"560d155f-01c6-4acb-b4b4-af80bb74f172","html_url":"https://github.com/blaze6950/GitHubActionsSample","commit_stats":null,"previous_names":["blaze6950/githubactionssample"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/blaze6950/GitHubActionsSample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaze6950%2FGitHubActionsSample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaze6950%2FGitHubActionsSample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaze6950%2FGitHubActionsSample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaze6950%2FGitHubActionsSample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blaze6950","download_url":"https://codeload.github.com/blaze6950/GitHubActionsSample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blaze6950%2FGitHubActionsSample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002973,"owners_count":26083489,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asp-net","asp-net-core","c-sharp","docker-image","github-actions","github-packages","github-workflow","nuget-package","workflow"],"created_at":"2025-10-10T06:21:49.752Z","updated_at":"2025-10-10T06:22:00.212Z","avatar_url":"https://github.com/blaze6950.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHubActionsSample\nAn example solution with api \u0026amp; NuGet package which shows the part of GitHub workflows functionality.\n\nIn the repo you can find a .NET solution with two projects:\n\n- [**GitHubActionsSample.Api** project](https://github.com/blaze6950/GitHubActionsSample/tree/master/src/GitHubActionsSample.Api) - it contains a simple API implementation with the usage of Swagger. Also, it uses the Nuget package from GPR.\n  - You can find [here](https://github.com/blaze6950/GitHubActionsSample/blob/f58de3856e71a747cb478c6065e372560e1d29b1/src/GitHubActionsSample.Api/GitHubActionsSample.Api.csproj#L12), that this projects has a dependency to the GitHubActionsSample.Package. There is no direct reference to the project in the solution. It is restored from the GPR.\n  - The Package source is configured in the [nuget.config](https://github.com/blaze6950/GitHubActionsSample/blob/master/nuget.config) file. There are also default nuget sources for restoring other packages.\n- [**GitHubActionsSample.Package** project](https://github.com/blaze6950/GitHubActionsSample/tree/master/packages/GitHubActionsSample.Package) - it contains a sample implementation with the Weather provider service. It is used for demonstrating how to build Nuget packages in GitHub Workflows and then use them in other projects.\n\n\u003e Note: it isn't a best practice to store package projects with the client projects. It was done for the simplicity to show the basic GitHub Actions/Workflows functionality.\n\n---\n\n# Workflows description\n### [API Workflow](https://github.com/blaze6950/GitHubActionsSample/blob/master/.github/workflows/api.yml)\nThis workflow has two jobs:\n\n- [\"build-and-test\"](https://github.com/blaze6950/GitHubActionsSample/blob/f58de3856e71a747cb478c6065e372560e1d29b1/.github/workflows/api.yml#L23) - accordingly to it's name its obviously that this job performs building and running tests for the GitHubActionsSample.Api project.\n  - It uses the \"actions/checkout@v3\" action for downloading the repo code to the job machine for further actions with it.\n  - It uses the \"actions/cache@v3.0.8\" action for caching the the downloaded \u0026 builded code. It helps to avoid downloading and building on the next job. This steps is executed in case, when the workflow is performed on the `master` branch, when we possibly will publish Docker image to the GDR. Otherwise, this step is omitted.\n  - It uses the \"actions/setup-dotnet@v2.1.1\" action for installing a .Net SDK on to the job machine. It allows to use the \"dotnet\" command in further acions.\n  - It uses the run step with name \"Put github token for the auth into GPR\". This command replaces a placeholder(`Token`) in the nuget.config file with the valid GITHUB_TOKEN for authenticating into GPR(This is required for restoring packages, namely GitHubActionsSample.Package).\n  - Also, almost the same command is used after the building and testing steps - but the valid GITHUB_TOKEN is replaced back to the placeholder(`TOKEN`). This is required due to the lifetime of the GITHUB_TOKEN - it is valid only within a single job execution. And we Need to roll back it to placeholder because we need to restore packages again in the next job.\n- [\"publish\"](https://github.com/blaze6950/GitHubActionsSample/blob/f58de3856e71a747cb478c6065e372560e1d29b1/.github/workflows/api.yml#L50) - accordingly to it's name this job builds a Docker image and publishes it to the Github Docker registry. This job is executed only when the workflow is executed on the `master` branch. Also, this job requires an approve from a user, which is specified in the `production` environment. Also, this job is performed only after the \"build-and-test\" job is successfully finished.\n  - It uses the \"actions/cache@v3.0.8\" action for restoring the downloaded \u0026 built code from cache(It was cached during the previous job). It helps to avoid the performing of redundant work.\n  - It uses the run command for replacing the placeholder in the nuget.config file to the valid GITHUB_TOKEN. As it was mentioned in the description of the previous job, the GITHUB_TOKEN has lifetime only within a single job. That's why we need to set it here again.\n  - It uses the \"VaultVulp/gp-docker-action@1.1.8\" action which is community built(Anyone can build his own actions and share with the community). It is useful for building a Docker image using Dockerfile in the repo and then publish it to the GitHub Docker Registry.\n\n### [Package Workflow](https://github.com/blaze6950/GitHubActionsSample/blob/master/.github/workflows/package.yml)\nThis workflow also has two jobs:\n\n- [\"build-and-test\"](https://github.com/blaze6950/GitHubActionsSample/blob/f58de3856e71a747cb478c6065e372560e1d29b1/.github/workflows/package.yml#L19)- accordingly to it's name its obviously that this job performs building and running tests for the GitHubActionsSample.Package project.\n  - It uses the \"actions/checkout@v3\" action for downloading the repo code to the job machine for further actions with it.\n  - It uses the \"actions/cache@v3.0.8\" action for caching the the downloaded \u0026 builded code. It helps to avoid downloading and building on the next job. This steps is executed in case, when the workflow is performed on the `master` branch, when we possibly will publish a Nuget package to the GPR. Otherwise, this step is omitted.\n  - It uses the \"actions/setup-dotnet@v2.1.1\" action for installing a .Net SDK on to the job machine. It allows to use the \"dotnet\" command in further acions.\n  - Two run steps in this job performs building and running tests.\n- [\"publish\"](https://github.com/blaze6950/GitHubActionsSample/blob/f58de3856e71a747cb478c6065e372560e1d29b1/.github/workflows/package.yml#L35) - accordingly to it's name this job builds a NuGet package and publishes it to the Github Package Registry. This job is executed only when the workflow is executed on the `master` branch. Also, this job requires an approve from a user, which is specified in the `production` environment. Also, this job is performed only after the \"build-and-test\" job is successfully finished.\n  - It uses the \"actions/cache@v3.0.8\" action for restoring the downloaded \u0026 built code from cache(It was cached during the previous job). It helps to avoid the performing of redundant work.\n  - It uses run commands for executing the `dotnet pack` \u0026 `dotnet nuget push` commands.\n\n\u003eYou can find more info in comments in the api.yml \u0026 package.yml files.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblaze6950%2Fgithubactionssample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblaze6950%2Fgithubactionssample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblaze6950%2Fgithubactionssample/lists"}