Skip to content

Commit

Permalink
chore(devops): build backend with actions
Browse files Browse the repository at this point in the history
  • Loading branch information
atakanyasar committed Apr 30, 2024
1 parent f0cb50f commit 6f8d586
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/backend_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: backend-worklow

on:
push:
paths:
- 'backend/**'
- docker-compose.yml
- docker-compose.dev.yml
- '.github/workflows/backend_build.yml'

pull_request:
branches:
- main
- staging
- develop


jobs:
build:
runs-on: ubuntu-latest
env:
working-directory:
backend
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Maven
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: Build Docker backend-dev Image
run: docker-compose -f docker-compose.dev.yml build db-dev

- name: Run Docker backend-dev Container
run: docker-compose -f docker-compose.dev.yml up -d db-dev

- name: Run Tests
run: mvn clean test

- name: Stop Docker backend-dev Container
run: docker-compose -f docker-compose.dev.yml down

- name: Build Docker backend-prod Image
run: docker-compose -f docker-compose.yml build db

- name: Run Docker backend-prod Container
run: docker-compose -f docker-compose.yml up -d db

- name: Run Tests
run: mvn clean test

- name: Stop Docker backend-prod Container
run: docker-compose -f docker-compose.yml down



0 comments on commit 6f8d586

Please sign in to comment.