name: image on: push: tags: - v* workflow_dispatch: env: REGISTRY_IMAGE: sentriz/gonic jobs: build: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[ci-skip]')" steps: - name: Checkout uses: actions/checkout@v2 - name: Set up QEMU uses: docker/setup-qemu-action@v1 with: image: tonistiigi/binfmt:latest platforms: all - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v1 with: install: true version: latest driver-opts: image=moby/buildkit:master - name: Login to DockerHub uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Set release version run: echo "RELEASE_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV - name: Build and Push uses: docker/build-push-action@v2 with: context: . file: ./Dockerfile platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7 push: true tags: | ${{ env.REGISTRY_IMAGE }}:latest ${{ env.REGISTRY_IMAGE }}:${{ env.RELEASE_VERSION }}