Update ci.yml

This commit is contained in:
Oskar 2021-10-19 23:07:23 +02:00 committed by GitHub
parent 230b2880c4
commit 4aa06d8389
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 2 deletions

View File

@ -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: