Skip to content

Commit

Permalink
Add CI, CD
Browse files Browse the repository at this point in the history
  • Loading branch information
creekorful committed Aug 26, 2021
1 parent 075be3f commit b691555
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ jobs:
with:
go-version: 1.16

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
go: [ 1.16 ]
go: [ 1.16, 1.17 ]
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -27,7 +27,6 @@ jobs:
run: |
echo "GOPATH=$(dirname $GITHUB_WORKSPACE)" >> $GITHUB_ENV
echo "$(dirname $GITHUB_WORKSPACE)/bin" >> $GITHUB_PATH
- name: Checkout Code
uses: actions/checkout@v2
with:
Expand All @@ -36,14 +35,12 @@ jobs:
- name: Install Dependencies
run: |
go get -v golang.org/x/lint/golint
- name: Lint source code
run: golint -set_exit_status ./...

- name: Run Tests
run: |
go test -race --coverprofile=coverage.coverprofile --covermode=atomic -v ./...
- name: Update go report card
if: success() && matrix.os == 'ubuntu-latest'
continue-on-error: true
Expand Down
11 changes: 11 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
project_name: parakeet

before:
hooks:
- go mod download
Expand All @@ -14,6 +16,15 @@ builds:
env:
- CGO_ENABLED=0

dockers:
- goos: linux
goarch: amd64
image_templates:
- "creekorful/parakeet:latest"
- "creekorful/parakeet:{{ replace .Tag \"v\" \"\" }}"
- "creekorful/parakeet:{{ .Major }}"
skip_push: false

checksum:
name_template: 'checksums.txt'

Expand Down
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM scratch

ADD parakeet /usr/bin/parakeet

ENTRYPOINT ["/usr/bin/parakeet"]

0 comments on commit b691555

Please sign in to comment.