Merge branch 'dev' into release #29
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: Java CI with Gradle | |
on: | |
push: | |
branches: [ release ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Make docker-compose.yml | |
run: echo "${{ secrets.DOCKER_COMPOSE }}" > docker-compose.yml | |
- name: Make Gateway application.yml | |
run: | | |
cd ./gateway/src/main/resources | |
echo "${{ secrets.GATEWAY_APPLICATION }}" > application.yml | |
- name: Make Warehouse application.yml | |
run: | | |
cd ./warehouse/src/main/resources | |
echo "${{ secrets.WAREHOUSE_APPLICATION }}" > application.yml | |
- name: Make Delivery application.yml | |
run: | | |
cd ./delivery/src/main/resources | |
echo "${{ secrets.DELIVERY_APPLICATION }}" > application.yml | |
- name: Build with Gradle | |
run: ./gradlew build | |
- name: Build and push Docker images | |
run: | | |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin | |
docker compose -f docker-compose.yml build | |
docker compose -f docker-compose.yml push | |
- name: Deploy to Server | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SERVER_IP }} | |
username: ${{ secrets.SERVER_USERNAME }} | |
key: ${{ secrets.SERVER_KEY }} | |
port: ${{ secrets.SSH_PORT }} | |
script: | | |
cd /home/${{ secrets.SERVER_USERNAME }}/Baobab-SERVER | |
docker compose down | |
docker compose pull | |
docker compose up -d |