From 758602b1e56698e28c5f8d8223db602f2985f978 Mon Sep 17 00:00:00 2001 From: vicanso Date: Sat, 16 Jan 2021 08:26:42 +0800 Subject: [PATCH] chore: add test build docker --- .github/workflows/testbuild.yml | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/testbuild.yml diff --git a/.github/workflows/testbuild.yml b/.github/workflows/testbuild.yml new file mode 100644 index 0000000..66230d7 --- /dev/null +++ b/.github/workflows/testbuild.yml @@ -0,0 +1,39 @@ +name: build on tag + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] +jobs: + build: + runs-on: ubuntu-latest + name: Build + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + - name: Set output + id: vars + run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} + - name: Set version + run: | + echo 'latest' > asset/version + cat asset/version + env | grep GITHUB_SHA + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/pike:${{ steps.vars.outputs.tag }} + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }}