Skip to content

Commit

Permalink
Added docker auto-release to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
networkop committed Feb 3, 2021
1 parent 939a332 commit 6243adb
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: docker

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
docker:
strategy:
matrix:
go-version: [1.15.x]
os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}
steps:
-
name: Checkout code
uses: actions/checkout@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to Container Registry
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and Push container images
run: |
make docker
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: release

on:
push:
tags:
- '*'

jobs:
release:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to Container Registry
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and Push container images
run: |
make release
14 changes: 14 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
before:
hooks:
- go mod download
builds:
- id: coredns
main: ./cmd/coredns.go
binary: coredns
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm64

0 comments on commit 6243adb

Please sign in to comment.