You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
978 B

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  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. cat config.yaml
  32. working-directory: ./server
  33. - name: Run
  34. run: |
  35. nohup ./gin-vue-admin &
  36. working-directory: ./server