Browse Source

Test env variables in github action

main
Granty1 5 years ago
parent
commit
7dae121e5b
  1. 8
      .github/workflows/go.yml
  2. 6
      server/config.yaml

8
.github/workflows/go.yml

@ -30,7 +30,13 @@ jobs:
run: | run: |
go build -v . go build -v .
working-directory: ./server 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 - name: Run
run: | run: |
nohup ./gin-vue-admin & nohup ./gin-vue-admin &

6
server/config.yaml

@ -10,9 +10,9 @@ jwt:
# mysql connect configuration # mysql connect configuration
mysql: mysql:
username: root
password: 'Aa@6447985'
path: '127.0.0.1:3306'
username: %{username}
password: %{password}
path: %{address}
db-name: 'qmPlus' db-name: 'qmPlus'
config: 'charset=utf8&parseTime=True&loc=Local' config: 'charset=utf8&parseTime=True&loc=Local'
max-idle-conns: 10 max-idle-conns: 10

Loading…
Cancel
Save