From 7dae121e5b1fc9c8afba40971e5daa4efd4b5c6a Mon Sep 17 00:00:00 2001 From: Granty1 Date: Thu, 9 Apr 2020 14:58:34 +0800 Subject: [PATCH] Test env variables in github action --- .github/workflows/go.yml | 8 +++++++- server/config.yaml | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 731c4e74..19fd39dc 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -30,7 +30,13 @@ jobs: run: | go build -v . working-directory: ./server - + - name: Modify config params + run: | + sed -i 's/%{address}/$MYSQL_ADDR/' config.yaml + sed -i 's/%{username}/$MYSQL_USERNAME/' config.yaml + sed -i 's/%{password}/$MSQL_PASSWORD/' config.yaml + cat config.yaml + working-directory: ./server - name: Run run: | nohup ./gin-vue-admin & diff --git a/server/config.yaml b/server/config.yaml index 66b4a319..3bf203b7 100644 --- a/server/config.yaml +++ b/server/config.yaml @@ -10,9 +10,9 @@ jwt: # mysql connect configuration mysql: - username: root - password: 'Aa@6447985' - path: '127.0.0.1:3306' + username: %{username} + password: %{password} + path: %{address} db-name: 'qmPlus' config: 'charset=utf8&parseTime=True&loc=Local' max-idle-conns: 10