Skip to content

Commit

Permalink
ci/cd: setup actions
Browse files Browse the repository at this point in the history
Signed-off-by: Glenn Vriesman <[email protected]>
  • Loading branch information
glvr182 committed Jun 5, 2020
1 parent 5680843 commit 1cbc5ce
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release

on:
push:
branches:
- master
tags:
- '*' # Push events to v1.0, v1.1, and v1.9 tags

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.14
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Set env
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/}

- name: Get dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: golangci-lint
uses: golangci/golangci-lint-action@v1
with:
version: v1.27

- name: Test
run: go test -v .

- name: Build
run: go build -v .

- name: Build
run: docker build -t ${GITHUB_REPOSITORY}:latest -t ${GITHUB_REPOSITORY}:${{ env.RELEASE_VERSION }} .

- name: Push latest to docker hub
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: glvr182/f2b-exporter
tag_with_ref: true
add_git_labels: true

0 comments on commit 1cbc5ce

Please sign in to comment.