You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.5 KiB
YAML
58 lines
1.5 KiB
YAML
name: Push to main
|
|
|
|
on:
|
|
workflow_dispatch: {}
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- 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
|
|
- name: Publish to Docker Hub
|
|
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
|
|
- name: Publish to GHCR
|
|
uses: jerray/publish-docker-action@master
|
|
with:
|
|
username: ${{ secrets.BOT_USERNAME }}
|
|
password: ${{ secrets.BOT_GHCR_PAT }}
|
|
file: dockerfiles/Dockerfile.self-contained
|
|
registry: ghcr.io
|
|
repository: containrrr/watchtower
|
|
tags: latest-dev
|