|
@@ -0,0 +1,68 @@
|
|
|
|
+name: Go
|
|
|
|
+
|
|
|
|
+on:
|
|
|
|
+ push:
|
|
|
|
+ branches: [ master ]
|
|
|
|
+ pull_request:
|
|
|
|
+ branches: [ master ]
|
|
|
|
+
|
|
|
|
+jobs:
|
|
|
|
+
|
|
|
|
+ build:
|
|
|
|
+ name: Build
|
|
|
|
+ strategy:
|
|
|
|
+ matrix:
|
|
|
|
+ os: [ubuntu-latest, macos-latest, windows-latest]
|
|
|
|
+ include:
|
|
|
|
+ - os: ubuntu-latest
|
|
|
|
+ path: |
|
|
|
|
+ ~/.cache/go-build
|
|
|
|
+ ~/go/pkg/mod
|
|
|
|
+ - os: macos-latest
|
|
|
|
+ path: |
|
|
|
|
+ ~/Library/Caches/go-build
|
|
|
|
+ ~/go/pkg/mod
|
|
|
|
+ - os: windows-latest
|
|
|
|
+ path: |
|
|
|
|
+ %LocalAppData%\go-build
|
|
|
|
+ ~/go/pkg/mod
|
|
|
|
+ runs-on: ubuntu-latest
|
|
|
|
+ steps:
|
|
|
|
+ - name: Set up Go 1.13
|
|
|
|
+ uses: actions/setup-go@v1
|
|
|
|
+ with:
|
|
|
|
+ go-version: 1.13
|
|
|
|
+ id: go
|
|
|
|
+
|
|
|
|
+ - name: Check out code into the Go module directory
|
|
|
|
+ uses: actions/checkout@v2
|
|
|
|
+
|
|
|
|
+ - name: cache
|
|
|
|
+ id: cache
|
|
|
|
+ uses: actions/cache@v2
|
|
|
|
+ with:
|
|
|
|
+ path: ${{ matrix.path }}
|
|
|
|
+ key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
|
|
+ restore-keys: |
|
|
|
|
+ ${{ runner.os }}-go-
|
|
|
|
+
|
|
|
|
+ - name: Get dependencies
|
|
|
|
+ run: |
|
|
|
|
+ go get -v -t -d ./...
|
|
|
|
+ if [ -f Gopkg.toml ]; then
|
|
|
|
+ curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
|
|
|
+ dep ensure
|
|
|
|
+ fi
|
|
|
|
+ working-directory: ./server
|
|
|
|
+
|
|
|
|
+ - name: Build
|
|
|
|
+ run: go build convert.go
|
|
|
|
+ working-directory: ./server
|
|
|
|
+
|
|
|
|
+ - name: docker push
|
|
|
|
+ run: |
|
|
|
|
+ docker login --username=${{ secrets.USERNAME }} --password ${{ secrets.PASSWORD }} ccr.ccs.tencentyun.com
|
|
|
|
+ docker build . -t jianboy/wordtohtml:v1.0.1
|
|
|
|
+ docker push jianboy/wordtohtml:v1.0.1
|
|
|
|
+ docker tag $(docker images jianboy/wordtohtml:v1.0.1 -q) jianboy/wordtohtml:latest
|
|
|
|
+ docker push jianboy/wordtohtml:latest
|