Skip to content

Commit

Permalink
Docker build step
Browse files Browse the repository at this point in the history
  • Loading branch information
mahesh-hegde committed Mar 9, 2024
1 parent b9186e7 commit 892b6c5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,21 @@ jobs:
go-version: '^1.21.2'
- name: Run tests
run: go test
build-docker-image:
runs-on: ubuntu-latest
needs: [unit-test]
if: ${{ startsWith(github.ref, 'refs/tags/') }}
env:
TAG_NAME: ${{ github.ref_name }}
IMAGE_NAME: ghcr.io/mahesh-hegde/zserv
steps:
- name: Docker login
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Docker build
run: docker build -t ghcr.io/mahesh-hegde/zserv:latest .
- name: Push latest image
run: docker push $IMAGE_NAME:latest
- name: Tag image
run: docker tag $IMAGE_NAME:latest $IMAGE_NAME:${TAG_NAME#v}
- name: Push tagged image
run: docker push $IMAGE_NAME:${TAG_NAME#v}

0 comments on commit 892b6c5

Please sign in to comment.