Skip to content

Commit

Permalink
Try use built in dotnet docker support for building an image.
Browse files Browse the repository at this point in the history
  • Loading branch information
Layoric committed Oct 3, 2023
1 parent cf7f796 commit fdf8edb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 39 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,17 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: setup .net core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.*'
dotnet-quality: 'preview'

# Build and push new docker image, skip for manual redeploy other than 'latest'
- name: Build and push Docker images
uses: docker/build-push-action@v3
if: ${{ github.event.inputs.version == '' || github.event.inputs.version == 'latest' }}
with:
file: Dockerfile
context: .
push: true
tags: ghcr.io/${{ env.image_repository_name }}:${{ env.TAG_NAME }}
- name: Build and push Docker image
run: |
dotnet publish --os linux --arch x64 -c Release -p:ContainerImageName=${{ env.image_repository_name }} -p:ContainerRegistry=ghcr.io -p:ContainerImageTags=${{ env.TAG_NAME }} -p:ContainerPort=8080
deploy_via_ssh:
needs: push_to_registry
Expand Down
31 changes: 0 additions & 31 deletions Dockerfile

This file was deleted.

6 changes: 6 additions & 0 deletions Gallery.Unified.Client/Gallery.Unified.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,11 @@
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
</ItemGroup>

<ItemGroup>
<Content Update="wwwroot\data\weather.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions Gallery.Unified/Gallery.Unified.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<Nullable>disable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MyApp</RootNamespace>
<PublishProfile>DefaultContainer</PublishProfile>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit fdf8edb

Please sign in to comment.