-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e6a656
commit 0224457
Showing
7 changed files
with
89 additions
and
10 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,5 @@ | ||
**/bin/* | ||
**/obj/* | ||
**/node_modules/* | ||
**/.github/* | ||
**/.idea/* |
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 |
---|---|---|
|
@@ -105,6 +105,23 @@ jobs: | |
env: | ||
MOLECULE_DISTRO: ${{ matrix.distro }} | ||
|
||
docker: | ||
name: Test docker container | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- run: > | ||
docker build | ||
--tag ghcr.io/vmelnalksnis/gnomeshade:test | ||
--build-arg "BUILD_NUMBER=${{ github.run_number }}" | ||
./ | ||
- run: docker run --name test -d -p 8000:80 ghcr.io/vmelnalksnis/gnomeshade:test | ||
- run: wget --tries=10 --retry-connrefused --waitretry=1 --timeout=15 "http://localhost:8000/health" | ||
- run: > | ||
[[ $(cat health) = "Healthy" ]] || exit 1 | ||
- run: docker logs test | ||
if: always() | ||
|
||
resharper: | ||
name: Resharper | ||
runs-on: ubuntu-latest | ||
|
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 |
---|---|---|
|
@@ -141,6 +141,25 @@ jobs: | |
--api-key ${{ secrets.NUGET_KEY }} | ||
--source https://api.nuget.org/v3/index.json | ||
docker: | ||
name: Build docker image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- run: > | ||
docker build | ||
--tag ghcr.io/vmelnalksnis/gnomeshade:nightly | ||
--build-arg "BUILD_NUMBER=${{ github.run_number }}" | ||
./ | ||
- run: docker push ghcr.io/vmelnalksnis/gnomeshade:nightly | ||
|
||
deploy-demo: | ||
name: Deploy demo app | ||
needs: build-linux | ||
|
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,29 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:6.0.403 AS build | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
npm \ | ||
zip | ||
|
||
WORKDIR /gnomeshade | ||
COPY ./ ./ | ||
ARG BUILD_NUMBER=123 | ||
RUN ./deployment/publish.sh "Gnomeshade.WebApi" "linux-musl-x64" $BUILD_NUMBER | ||
|
||
RUN ls /gnomeshade/source/Gnomeshade.WebApi/bin/Release/net6.0/linux-musl-x64/publish/ -lah | ||
|
||
FROM mcr.microsoft.com/dotnet/runtime-deps:6.0.11-alpine3.16 as gnomeshade | ||
|
||
COPY --from=build /gnomeshade/source/Gnomeshade.WebApi/bin/Release/net6.0/linux-musl-x64/publish/Gnomeshade.WebApi /gnomeshade/ | ||
COPY --from=build /gnomeshade/source/Gnomeshade.WebApi/bin/Release/net6.0/linux-musl-x64/publish/libe_sqlite3.so /gnomeshade/ | ||
COPY --from=build /gnomeshade/source/Gnomeshade.WebApi/bin/Release/net6.0/linux-musl-x64/publish/appsettings.json ./gnomeshade/ | ||
COPY --from=build /gnomeshade/source/Gnomeshade.WebApi/bin/Release/net6.0/linux-musl-x64/publish/wwwroot/ /gnomeshade/wwwroot | ||
|
||
ENV Database__Provider="Sqlite" \ | ||
ConnectionStrings__Gnomeshade="Data Source=/data/gnomeshade.db" \ | ||
Jwt__ValidAudience="http://localhost:5000" \ | ||
Jwt__ValidIssuer="http://localhost:5000" \ | ||
Jwt__Secret="280ba7e4-d323-4232-8107-3b8c1b0832a8" | ||
|
||
VOLUME /data | ||
EXPOSE 80 | ||
ENTRYPOINT ["/gnomeshade/Gnomeshade.WebApi"] |
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
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,4 +1,4 @@ | ||
#!/bin/bash | ||
#!/bin/sh | ||
set -e | ||
|
||
dotnet restore --locked-mode /p:Configuration="Release" |