Skip to content

Added cd file + changed the name of the app into fullstackjava-api #1

Added cd file + changed the name of the app into fullstackjava-api

Added cd file + changed the name of the app into fullstackjava-api #1

Workflow file for this run

name: CD - Deploy Backend
on:
workflow_dispatch:
push:
branches:
- master
paths:
- backend/**
jobs:
deploy:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15.3
env:
POSTGRES_USER: rachid
POSTGRES_PASSWORD: password
POSTGRES_DB: fullstackjava
ports:
- 5432:5432
options:
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
defaults:
run:
working-directory: ./backend
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_ACCESS_TOKEN}}
- name: Set build number
id: build-number
run: echo "BUILD_NUMBER=$(date '+%d.%m.%Y.%H.%M.%S')" >> $GITHUB_OUTPUT
- name: Build package push with maven
- run: mvn -ntp -B verify -Ddocker.image.tag=${{steps.build-number.outputs.BUILD_NUMBER}} jib:build