trying another context #19
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: Server CI | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'server/**' | |
- '.github/workflows/server-ci.yaml' | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./server | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20.x' | |
- name: SCA & Go vet | |
run: | | |
go install honnef.co/go/tools/cmd/staticcheck@latest | |
staticcheck ./... | |
go vet ./... | |
- name: Install dependencies | |
run: go get ./... | |
- name: Test | |
run: go test ./... | |
- name: Build server | |
run: go build -o digits-server ./... | |
- name: Upload binary artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: digits | |
path: ./server/digits-server | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./server/ | |
push: true | |
tags: lornest/digits:latest |