go.yml 960 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. name: gin-vue-admin ci&cd
  2. on:
  3. push:
  4. branches: [ action-ci ]
  5. jobs:
  6. build:
  7. name: Build
  8. runs-on: [ self-hosted ]
  9. steps:
  10. - name: Check out the repository
  11. uses: actions/checkout@v2
  12. - name: Show files
  13. run: ls -la
  14. - name: Get dependencies
  15. run: |
  16. go get -v -t -d ./...
  17. if [ -f Gopkg.toml ]; then
  18. curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
  19. dep ensure
  20. fi
  21. working-directory: ./server
  22. - name: Build
  23. run: |
  24. go build -v .
  25. working-directory: ./server
  26. - name: Modify config params
  27. run: |
  28. sed -i 's/%{address}/'$MYSQL_ADDR'/' config.yaml
  29. sed -i 's/%{username}/'$MYSQL_USERNAME'/' config.yaml
  30. sed -i 's/%{password}/'$MSQL_PASSWORD'/' config.yaml
  31. working-directory: ./server
  32. - name: Run
  33. run: |
  34. nohup ./gin-vue-admin &
  35. working-directory: ./server