Skip to content

update

update #73

Workflow file for this run

name: Go CI
on:
workflow_dispatch:
push:
branches: [main]
paths-ignore:
- '**/*.md'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Cache Go modules
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install dependencies
run: cd go-app && go mod download
- name: Build
run: cd go-app && go build -v ./...
- name: Test
run: cd go-app && go test ./...
- name: running tidy
run: go mod init github.com/charan-happy/MyApp/go-app
#- name: Install golangci-lint
# run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
#- name: Run Linter
# run: golangci-lint run
- name: Dockerhub Login
uses: docker/[email protected]
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build Docker image
run: docker build -t ${{ vars.DOCKERHUB_USERNAME }}/go-app ./go-app
- name: Push Docker image
run: docker push ${{ vars.DOCKERHUB_USERNAME }}/go-app