Skip to content

Backend dev

Backend dev #44

Workflow file for this run

name: deploy
on:
push:
branches: [ "dev/back/exchange" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: "temurin"
- name: Build with Gradle
run: |
cd ./back-end/timebank/EUM-Bank
./gradlew bootJar
# - name: Setup Gradle
# uses: gradle/actions/setup-gradle@v3
# - name: Build with Gradle
# run: |
# cd ./EUM-Bank
# ./gradlew build
- name: Docker build & push to docker hub
run: |
cd ./back-end/timebank/EUM-Bank
docker login -u ${{ secrets.DOCKER_USERNAME_YSY }} -p ${{ secrets.DOCKER_PASSWORD_YSY }}
docker build -t ${{ secrets.DOCKER_REPO_BANK }} .
docker push ${{ secrets.DOCKER_REPO_BANK }}
- name: Deploy to server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST_BANK }}
username: ${{ secrets.HOSTNAME_BANK }}
password: ${{ secrets.SSH_BANK_PWD }}
script: |
docker pull ${{ secrets.DOCKER_REPO_BANK }}
cd EUM-Bank-docker
echo "${{ secrets.BANK_ENV }}" > .env
docker-compose up --build -d
docker image prune -f