Logic on properly deploying things

So I've been getting into a more professional workflow (id say) with better github practices, working with containers and orchestrators and such But now that I don't "manually" deploy my programs onto a server anymore, I got a question about my config files For example if I make a discord bot I wouldn't hardcode the details but rather make the bot create a folder for itself for things like the database it needs to run or the config for me to put the bot token into How would I go on about giving the token to the bot for example, do I just ship the config file and folder with the image or is there some other workflow
13 Replies
Angius
Angius3mo ago
You would use a secret store Like Azure Key Vault, for example
Somgör from Human Resources
But wouldn't that need some authentication too which would mean I'd need to somehow supply my program with the keystore?
Angius
Angius3mo ago
You can store that in the secrets in the GH repo, and use that to set the env variable or something inside of your GH action I guess you could directly just do that with the Discord token or whatever, but using something like KeyVault lets you change the secrets without the need for a redeploy
Somgör from Human Resources
I mean I don't really mind the redeploy tbh
Angius
Angius3mo ago
Skip KV, then
Somgör from Human Resources
Can you go more into detail about storing them inside of the repo?
Angius
Angius3mo ago
No description
Somgör from Human Resources
Perfect I'll have a look, thanks!
Angius
Angius3mo ago
Here's how I deploy one of my Nuget packages, for example
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: dotnet build --configuration Release
- name: Pack
run: dotnet pack --configuration Release --no-build --output ./artifacts NpgSqlSourceGenerator/NpgSqlSourceGenerator.csproj
- name: Push
run: dotnet nuget push ./artifacts/Atulin.NpgSqlSourceGenerator.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_KEY }}
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: dotnet build --configuration Release
- name: Pack
run: dotnet pack --configuration Release --no-build --output ./artifacts NpgSqlSourceGenerator/NpgSqlSourceGenerator.csproj
- name: Push
run: dotnet nuget push ./artifacts/Atulin.NpgSqlSourceGenerator.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_KEY }}
No description
Angius
Angius3mo ago
${{ secrets.NUGET_KEY }} references that secret
Somgör from Human Resources
How would I be able to access those secrets using my program once deployed?
Angius
Angius3mo ago
You would set them on the server during deployment Either by creating a file with env variables, editing the project settings, or just setting an env variable on the server
Want results from more Discord servers?
Add your server
More Posts
System.AggregateException: 'Some services are not able to be constructedI stuck with this problem and don't understand how to fix it: InvalidOperationException: Unable to rMAUI. How to remove the Title Bar?I need to remove the top panel so that the user can not use the buttons on it.Help me sort out perhaps badly done folder/solution structure so I can add a shared Class LibraryOk, so I have two solutions which must be separate so I can execute them both at the same time so thUsing Roslyn in WebAssembly, error creating an AdHocWorkspaceHello, this could be a really convoluted use case and I don't know what sort of support is expected SignalR Blocking Issue: Infinite Wait When Calling a Method from ClientHello here is a Hub I implemented, the goal is to make a board game turn system, the most important How to connect to database? WPFHi, I was searching how to connect to database, but I couldn't find anything. I mean to connect non-✅ Help needed with WPF GUI# Hello, Good Day! ## Overview I just started with WPF a few weeks ago so I'm still quite new to aHelp in need to have an opinion about Scheduler -> Email notificationHello, I need help. Is there a way to modify or create function that will send an email if there is ✅ I cant combine folder pathsI was trying to combine folder path with strings with that code ```c# string ilce = duzenleIlce.TexWhy isnt my player being deleted and the scene changed?I have these 2 scripts here that together should control the enemies ability to kill the player and