Skip to content

Commit

Permalink
#002 - adjusts on workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
deyvisonborges committed Apr 23, 2024
1 parent f1f1619 commit 55b581c
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
- 'feature/**'
- 'bugfix/**'

env:
IMAGE_NAME: ${{ github.repository }}
JAR_FILE: application.jar

jobs:
tests:
name: Tests Runner
Expand All @@ -30,7 +34,7 @@ jobs:
run: ./gradlew test

build:
name: Build application
name: Build Runner
needs: tests
runs-on: ubuntu-latest
steps:
Expand All @@ -53,12 +57,16 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set env
run: echo "DATE=$(date +%s)" >> $GITHUB_ENV
- uses: docker/metadata-action@v4
id: meta
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: type=sha

- name: Build and push image
uses: docker/build-push-action@v3
- uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.DATE }}
tags: ${{ steps.meta.outputs.tags }}
build-args: |
JAR_FILE=${{ env.JAR_FILE }}

0 comments on commit 55b581c

Please sign in to comment.