build.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. name: Go
  2. on:
  3. push:
  4. branches: [ master ]
  5. pull_request:
  6. branches: [ master ]
  7. jobs:
  8. build:
  9. name: Build
  10. strategy:
  11. matrix:
  12. os: [ubuntu-latest, macos-latest, windows-latest]
  13. include:
  14. - os: ubuntu-latest
  15. path: |
  16. ~/.cache/go-build
  17. ~/go/pkg/mod
  18. - os: macos-latest
  19. path: |
  20. ~/Library/Caches/go-build
  21. ~/go/pkg/mod
  22. - os: windows-latest
  23. path: |
  24. %LocalAppData%\go-build
  25. ~/go/pkg/mod
  26. runs-on: ubuntu-latest
  27. steps:
  28. - name: Set up Go 1.13
  29. uses: actions/setup-go@v1
  30. with:
  31. go-version: 1.13
  32. id: go
  33. - name: Check out code into the Go module directory
  34. uses: actions/checkout@v2
  35. - name: cache
  36. id: cache
  37. uses: actions/cache@v2
  38. with:
  39. path: ${{ matrix.path }}
  40. key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
  41. restore-keys: |
  42. ${{ runner.os }}-go-
  43. - name: Get dependencies
  44. run: |
  45. go get -v -t -d ./...
  46. if [ -f Gopkg.toml ]; then
  47. curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
  48. dep ensure
  49. fi
  50. working-directory: ./server
  51. - name: Build
  52. run: go build convert.go
  53. working-directory: ./server
  54. - name: docker push
  55. run: |
  56. docker login --username=${{ secrets.USERNAME }} --password ${{ secrets.PASSWORD }} ccr.ccs.tencentyun.com
  57. docker build . -t jianboy/wordtohtml:v1.0.1
  58. docker push jianboy/wordtohtml:v1.0.1
  59. docker tag $(docker images jianboy/wordtohtml:v1.0.1 -q) jianboy/wordtohtml:latest
  60. docker push jianboy/wordtohtml:latest