From 94a8d05cd979b166a677ee371ecfd65d1786e1df Mon Sep 17 00:00:00 2001 From: wlanboy Date: Sat, 14 Nov 2020 11:18:37 +0100 Subject: [PATCH] Create githubpublish.yml --- .github/workflows/githubpublish.yml | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/githubpublish.yml diff --git a/.github/workflows/githubpublish.yml b/.github/workflows/githubpublish.yml new file mode 100644 index 0000000..0b583b6 --- /dev/null +++ b/.github/workflows/githubpublish.yml @@ -0,0 +1,38 @@ +name: Docker build and publish image to github +on: + push: + tags: + - '*g' +jobs: + build: + 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: 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 + - name: Build + run: go build -v . + + - name: Build and publish Docker Image to GitHub Packages Registry + uses: VaultVulp/gp-docker-action@1.1.7 + with: + github-token: ${{ github.token }} + image-name: goservice + image-tag: latest + extract-git-tag: false + dockerfile: Dockerfile + build-context: . + pull-image: false