-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Convert to Azure Container App
Merge pull request #24 from DFE-Digital/convert-to-container-app
- Loading branch information
Showing
16 changed files
with
256 additions
and
264 deletions.
There are no files selected for viewing
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,82 @@ | ||
name: Docker Publish | ||
on: | ||
release: | ||
types: [published] | ||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
RELEASE_TAG: ${{ github.event.release.tag_name }} | ||
jobs: | ||
build: | ||
name: 'Docker Publish' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
# This is used to complete the identity challenge with sigstore/fulcio when running outside of PRs. | ||
id-token: write | ||
steps: | ||
# Checkout the release tag version | ||
- name: Checkout repository ${{ env.RELEASE_TAG }} | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ env.RELEASE_TAG }} | ||
# Get git commit hash | ||
- name: Get short hash | ||
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | ||
# Need to lower case the image name for the docker tags when publishing | ||
- name: Downcase IMAGE_NAME variable | ||
run: echo "IMAGE_NAME_LOWER=${IMAGE_NAME,,}" >> $GITHUB_ENV | ||
|
||
# Sort out the image tags | ||
- name: Set initial tag | ||
run: echo "IMAGE_TAGS=${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LOWER }}:${{ env.RELEASE_TAG }}" >> $GITHUB_ENV | ||
- name: Add latest tag if we're not production release | ||
if: contains(env.RELEASE_TAG, 'next') | ||
run: echo "IMAGE_TAGS=${{ env.IMAGE_TAGS }},${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LOWER }}:latest" >> $GITHUB_ENV | ||
#debug | ||
- name: Log the tags | ||
run: echo "Calculated tags value => ${{ env.IMAGE_TAGS }}" | ||
# Setup docker build tool | ||
- name: Setup Docker buildx | ||
uses: docker/setup-buildx-action@v3 | ||
# Login against a Docker registry | ||
- name: Log into registry ${{ env.REGISTRY }} | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
# Extract metadata (tags, labels) for Docker | ||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
# Build and push Docker image with Buildx (don't push on PR) | ||
- name: Build and push Docker image | ||
id: build-and-push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./src | ||
file: ./src/Childrens-Social-Care-CPD-Indexer/Dockerfile | ||
push: true | ||
tags: ${{ env.IMAGE_TAGS }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
build-args: | | ||
VCSREF=${{ env.sha_short }} | ||
VCSTAG=${{ env.RELEASE_TAG }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
# Sign the resulting Docker image digest. | ||
# This will only write to the public Rekor transparency log when the Docker | ||
# repository is public to avoid leaking data. If you would like to publish | ||
# transparency data even for private images, pass --force to cosign below. | ||
# https://github.com/sigstore/cosign | ||
- name: Install Cosign | ||
uses: sigstore/[email protected] | ||
- name: Check install! | ||
run: cosign version | ||
- name: Sign the published Docker image | ||
# This step uses the identity token to provision an ephemeral certificate against the sigstore community Fulcio instance. | ||
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign --yes {}@${{ steps.build-and-push.outputs.digest }} |
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,31 +1,31 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.8.34322.80 | ||
VisualStudioVersion = 17.8.34330.188 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Childrens-Social-Care-CPD-Indexer.Tests", "Childrens-Social-Care-CPD-Indexer.Tests\Childrens-Social-Care-CPD-Indexer.Tests.csproj", "{6984BF56-808E-4294-949D-FFE4B02CCE16}" | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Childrens-Social-Care-CPD-Indexer", "Childrens-Social-Care-CPD-Indexer\Childrens-Social-Care-CPD-Indexer.csproj", "{F2710DEC-7B59-484A-9D04-F73B1E09563A}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Childrens-Social-Care-CPD-Indexer", "Childrens-Social-Care-CPD-Indexer\Childrens-Social-Care-CPD-Indexer.csproj", "{3555944D-1913-4979-B5BF-991C7064613E}" | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Childrens-Social-Care-CPD-Indexer.Tests", "Childrens-Social-Care-CPD-Indexer.Tests\Childrens-Social-Care-CPD-Indexer.Tests.csproj", "{F0344BA1-9B92-42A7-B650-B8064EDD2B9E}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{6984BF56-808E-4294-949D-FFE4B02CCE16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{6984BF56-808E-4294-949D-FFE4B02CCE16}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{6984BF56-808E-4294-949D-FFE4B02CCE16}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{6984BF56-808E-4294-949D-FFE4B02CCE16}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{3555944D-1913-4979-B5BF-991C7064613E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{3555944D-1913-4979-B5BF-991C7064613E}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{3555944D-1913-4979-B5BF-991C7064613E}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{3555944D-1913-4979-B5BF-991C7064613E}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{F2710DEC-7B59-484A-9D04-F73B1E09563A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{F2710DEC-7B59-484A-9D04-F73B1E09563A}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{F2710DEC-7B59-484A-9D04-F73B1E09563A}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{F2710DEC-7B59-484A-9D04-F73B1E09563A}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{F0344BA1-9B92-42A7-B650-B8064EDD2B9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{F0344BA1-9B92-42A7-B650-B8064EDD2B9E}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{F0344BA1-9B92-42A7-B650-B8064EDD2B9E}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{F0344BA1-9B92-42A7-B650-B8064EDD2B9E}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {EEC0CA75-7434-4AC0-9F45-31CA6CC7D59A} | ||
SolutionGuid = {5F3E3B0D-C6EA-4304-851B-75680DAB332E} | ||
EndGlobalSection | ||
EndGlobal |
39 changes: 12 additions & 27 deletions
39
src/Childrens-Social-Care-CPD-Indexer/Childrens-Social-Care-CPD-Indexer.csproj
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 |
---|---|---|
@@ -1,39 +1,24 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<Project Sdk="Microsoft.NET.Sdk.Worker"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<AzureFunctionsVersion>v4</AzureFunctionsVersion> | ||
<OutputType>Exe</OutputType> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<UserSecretsId>dotnet-Childrens_Social_Care_CPD_Indexer-907bada8-7f54-479d-b04e-45ec4f148332</UserSecretsId> | ||
<RootNamespace>Childrens_Social_Care_CPD_Indexer</RootNamespace> | ||
<DockerFastModeProjectMountDirectory>/home/site/wwwroot</DockerFastModeProjectMountDirectory> | ||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<InternalsVisibleTo Include="Childrens-Social-Care-CPD-Indexer.Tests" /> | ||
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<InternalsVisibleTo Include="Childrens-Social-Care-CPD-Indexer.Tests" /> | ||
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Azure.Search.Documents" Version="11.5.1" /> | ||
<PackageReference Include="contentful.csharp" Version="7.5.0" /> | ||
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.20.0" /> | ||
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.1.0" /> | ||
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.16.2" /> | ||
<PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.22.0" /> | ||
<PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="1.0.0" /> | ||
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="7.0.3" /> | ||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" /> | ||
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="7.2.0" /> | ||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Update="host.json"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
<None Update="local.settings.json"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
<CopyToPublishDirectory>Never</CopyToPublishDirectory> | ||
</None> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Using Include="System.Threading.ExecutionContext" Alias="ExecutionContext" /> | ||
</ItemGroup> | ||
</Project> | ||
</Project> |
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
Oops, something went wrong.