Skip to content

Commit

Permalink
Criação do deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
tibetteixeira committed May 22, 2024
1 parent abe5408 commit f04fda8
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy

on:
push:
branches:
- main
- master

jobs:
run-unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Docker Login
uses: docker/login-action@v2.0.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'adopt'
cache: maven

- name: Build Application JAR
run: mvn clean package

- name: Docker Compose Build
run: docker compose build

- name: Push to DockerHub Container Registry
run: |
docker tag ${{ secrets.DOCKER_USERNAME }}/minhas-financas:latest ${{ secrets.DOCKER_USERNAME }}/minhas-financas:${{ github.run_id }}
docker push ${{ secrets.DOCKER_USERNAME }}/minhas-financas:${{ github.run_id }}
docker push ${{ secrets.DOCKER_USERNAME }}/minhas-financas:latest

0 comments on commit f04fda8

Please sign in to comment.