Skip to content
Merged

Dev #42

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/cd-build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}

# Enable multi-arch
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

# Enable buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# Login to GHCR
- name: Login to GHCR
Expand Down Expand Up @@ -46,6 +54,7 @@ jobs:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
secrets: |
Expand Down
9 changes: 4 additions & 5 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,20 @@ type Db struct {

// LoadConfig loads configuration from file and environment variables
func LoadConfig() (*Config, error) {
_ = godotenv.Load(".env")

var cfg Config
vp := viper.New()

vp.SetConfigFile("configs/config.yaml")
vp.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
vp.AutomaticEnv()

if err := vp.ReadInConfig(); err != nil {
var configFileNotFoundError viper.ConfigFileNotFoundError
if !errors.As(err, &configFileNotFoundError) {
return nil, fmt.Errorf("error reading config file: %w", err)
}
}
_ = godotenv.Load(".env")

vp.AutomaticEnv()
vp.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))

if err := vp.Unmarshal(&cfg); err != nil {
return nil, fmt.Errorf("unmarshal error: %w", err)
Expand Down