Skip to content

Update GitHub Actions for branch '75-back' push events' #34

Update GitHub Actions for branch '75-back' push events'

Update GitHub Actions for branch '75-back' push events' #34

Workflow file for this run

name: deploy
on:
push:
branches: [ "75-back-retrieve-userinfos-from-haetsal-service" ]
pull_request:
branches: [ "dev/back/exchange" ]
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 ./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 ./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