diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 179a363..4784ee7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,7 @@ on: push: branches: - main + pull_request: permissions: @@ -12,6 +13,7 @@ permissions: jobs: ci: runs-on: ubuntu-latest + steps: - name: Repo clone (go mod tidy / gofmt) if: github.event_name != 'pull_request' @@ -30,14 +32,14 @@ jobs: git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" - - name: tidy + - name: Tidy if: github.event_name != 'pull_request' run: | go mod tidy -go=1.17 git add . git diff-index --quiet HEAD || git commit -m "go mod tidy" - - name: gofmt + - name: GoFmt if: github.event_name != 'pull_request' run: | go fmt ./... @@ -66,6 +68,13 @@ jobs: with: fetch-depth: 0 + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: