diff --git a/.github/workflows/release-dev.yaml b/.github/workflows/release-dev.yaml index 5005b2e96..7928e4520 100644 --- a/.github/workflows/release-dev.yaml +++ b/.github/workflows/release-dev.yaml @@ -1,23 +1,47 @@ -name: Release (Develop) +name: Push to main on: + workflow_dispatch: {} push: branches: - main jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - uses: jerray/publish-docker-action@master - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - file: dockerfiles/Dockerfile.self-contained - repository: containrrr/watchtower - tags: latest-dev + - uses: actions/checkout@v2 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.15 + - name: Build + run: go build -v ./... + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.15 + - name: Test + run: go test -v -coverprofile coverage.out -covermode atomic ./... + - name: Publish coverage + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + publish: + needs: + - build + - test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: jerray/publish-docker-action@master + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + file: dockerfiles/Dockerfile.self-contained + repository: containrrr/watchtower + tags: latest-dev diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3083abb0d..de72102a4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,7 @@ name: Release (Production) on: + workflow_dispatch: {} release: types: - created