drop backend leftovers form ci piplile #90
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: [push, pull_request] | |
jobs: | |
build: | |
name: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: set up go 1.20 | |
uses: actions/setup-go@v3 | |
with: | |
go-version: "1.20" | |
id: go | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: test | |
run: | | |
go test -v -mod=vendor -timeout=60s -covermode=count -coverprofile=$GITHUB_WORKSPACE/profile.cov_tmp ./... | |
cat $GITHUB_WORKSPACE/profile.cov_tmp | grep -v "mock_" > $GITHUB_WORKSPACE/profile.cov | |
working-directory: app | |
env: | |
TZ: "America/Chicago" | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: latest | |
- name: install goveralls | |
run: go install github.com/mattn/goveralls@latest | |
- name: build | |
run: go build -v -mod=vendor | |
working-directory: app | |
- name: submit coverage | |
run: $(go env GOPATH)/bin/goveralls -service="github" -coverprofile=$GITHUB_WORKSPACE/profile.cov | |
env: | |
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: build pr image | |
if: github.event_name == 'pull_request' | |
run: docker build -t umputun/secrets:master . | |
- name: build and push master image | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
run: | | |
docker build -t umputun/secrets:master . | |
docker login --username ${{ secrets.DOCKERHUB_USER }} --password ${{ secrets.DOCKERHUB_PASSWD }} | |
docker push umputun/secrets:master | |
- name: build and push tagged image | |
if: github.event_name == 'push' && github.event.ref_type == 'tag' | |
run: | | |
GIT_TAG="${GITHUB_REF#refs/tags/}" | |
docker build -t umputun/secrets:${GIT_TAG} . | |
docker login --username ${{ secrets.DOCKERHUB_USER }} --password ${{ secrets.DOCKERHUB_PASSWD }} | |
docker push umputun/secrets:${GIT_TAG} | |
docker tag umputun/secrets:${GIT_TAG} umputun/secrets:latest | |
docker push umputun/secrets:latest |