Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
chs98412 authored Jul 24, 2024
1 parent d25dc1d commit 9a8c6ea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,16 @@ jobs:
- name: Build with Gradle
run: ./gradlew -x test build

- name: Extract build date
id: vars
run: echo "BUILD_DATE=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV

- name: Docker build & push to prod
if: contains(github.ref, 'main')
run: |
docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_PASSWORD }}
docker build -t ${{ secrets.DOCKER_HUB_USERNAME }}/example-project .
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/example-project:${{ github.sha }}
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/example-project:${{ env.BUILD_DATE }}
deploy:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 9a8c6ea

Please sign in to comment.