Change setting for application #63
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CD - Deploy Backend | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- hla-product-ordering/backend/** | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_USER: hlauser | |
POSTGRES_PASSWORD: hlapassword | |
POSTGRES_DB: hla | |
ports: | |
- 5332:5432 | |
options: | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
defaults: | |
run: | |
working-directory: ./hla-product-ordering/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 | |
- name: Deploy to Elastic Beanstalk | |
uses: einaregilsson/beanstalk-deploy@v21 | |
with: | |
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
application_name: ${{ secrets.EB_APPLICATION_NAME }} | |
environment_name: ${{ secrets.EB_ENVIRONMENT_NAME }} | |
version_label: hla-backend-api-source-4 | |
version_description: ${{ github.SHA }} | |
region: ${{ secrets.EB_REGION }} |