Skip to content

Commit

Permalink
build docker image in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
povilasv committed Apr 25, 2022
1 parent d468fd4 commit a7b3e32
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,31 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Build
run: make build
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker metadata for Tracetest
id: meta
uses: docker/metadata-action@v3
with:
images: kubeshop/tracetest
tags: |
type=match,pattern=v(.*)
type=sha
flavor: |
latest=true
- name: Build and push Tracetest
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit a7b3e32

Please sign in to comment.