Skip to content

Commit

Permalink
feat: add ci/cd to build and push docker image to dockerhub
Browse files Browse the repository at this point in the history
Signed-off-by: MatheusVict <[email protected]>
  • Loading branch information
MatheusVict committed Apr 23, 2024
1 parent 729f692 commit e9752b3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public"
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/test_db?schema=public"
JWT_SECRET="variosnumerosletrasesimbolosmisturadosparasegurançadosecret"
# A variável abaixo é referente ao tempo que o token vai durar, "1h" no caso é uma hora.
# Possíveis valores: Xm Xh Xd Xw XM onde X é qualquer valor, m são minutos, h são horas
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/build_and_push_image_to_docker_hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,27 @@ on:
- develop

jobs:

build-and-push:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test_db
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Copy .env.example to .env
run: cp .env.example .env

- name: Log in to Docker hub
uses: docker/[email protected]
Expand Down

0 comments on commit e9752b3

Please sign in to comment.