diff --git a/.editorconfig b/.editorconfig index bc9a7ae..2e009f1 100644 --- a/.editorconfig +++ b/.editorconfig @@ -27,6 +27,7 @@ insert_final_newline = false dotnet_diagnostic.IDE0058.severity = none dotnet_diagnostic.IDE0100.severity = none dotnet_diagnostic.IDE3000.severity = none +dotnet_diagnostic.CA1848.severity = none # Organize usings dotnet_separate_import_directive_groups = true diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cb7cf60..c991a48 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -32,7 +32,7 @@ jobs: - name: Build and push server image run: | TAG=${{ secrets.DOCKERHUB_USERNAME }}/groundsforsupport.stevanfreeborn.com:${{ steps.version.outputs.version }} - docker build -t $TAG src/ + docker build --build-arg VITE_STRIPE_API_KEY=${{ secrets.VITE_STRIPE_API_KEY }} -t $TAG src/ docker push $TAG deploy: name: Deploy to server @@ -60,5 +60,9 @@ jobs: --restart always \ -d \ -p 4343:8080 \ + -e StripeOptions__ApiKey=${{ secrets.STRIPE_API_KEY }} \ + -e StripeOptions__EventsWebhookSecret=${{ secrets.STRIPE_EVENTS_WEBHOOK_SECRET }} \ + -e ContextOptions__DatabaseFilePath=/app/data/groundsforsupport.db \ + -v /home/${{ secrets.SSH_USERNAME }}/groundsforsupport.stevanfreeborn.com/data:/app/data \ --name groundsforsupport.stevanfreeborn.com \ $TAG diff --git a/.gitignore b/.gitignore index f588023..ab2381a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,9 @@ appsettings*.json !appsettings.Example.json wwwroot/ +*.db +*.db-shm +*.db-wal # dotenv files .env diff --git a/src/Dockerfile b/src/Dockerfile index 8fbac17..8c42e2c 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -12,6 +12,8 @@ RUN apt-get update && \ COPY ["GroundsForSupport.Server/GroundsForSupport.Server.csproj", "GroundsForSupport.Server/"] RUN dotnet restore "GroundsForSupport.Server/GroundsForSupport.Server.csproj" +ARG VITE_STRIPE_API_KEY +ENV VITE_STRIPE_API_KEY=$VITE_STRIPE_API_KEY COPY . . WORKDIR "/src/GroundsForSupport.Server" RUN dotnet build "GroundsForSupport.Server.csproj" -c Release -o /app/build diff --git a/src/GroundsForSupport.Server/appsettings.Example.json b/src/GroundsForSupport.Server/appsettings.Example.json index 743e09a..07f8b1e 100644 --- a/src/GroundsForSupport.Server/appsettings.Example.json +++ b/src/GroundsForSupport.Server/appsettings.Example.json @@ -1,5 +1,9 @@ { "StripeOptions": { - "ApiKey": "ApiKey" + "ApiKey": "ApiKey", + "EventsWebhookSecret": "EventsWebhookSecret" + }, + "ContextOptions": { + "DatabaseFilePath": "DatabaseFilePath" } }