Skip to content

Type: 시작안한 챌린지 조회 - 주제 검색 추가 (#72) #37

Type: 시작안한 챌린지 조회 - 주제 검색 추가 (#72)

Type: 시작안한 챌린지 조회 - 주제 검색 추가 (#72) #37

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
name: Java CI with Gradle
on:
push:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: make application.properties
run: |
cd ./src/main/resources
touch ./application.properties
# GitHub-Actions 에서 설정한 값을 application.properties 파일에 쓰기
echo "${{ secrets.PROPERTIES }}" >> ./application.properties
shell: bash
# 환경 변수 설정 (Firebase)
- name: create-json
id: create-json
uses: jsdaniell/[email protected]
with:
name: ${{ secrets.FIREBASE_JSON_FILENAME }}
json: ${{ secrets.FIREBASE_JSON }}
dir: 'src/main/resources'
- name: Build with Gradle
run: |
chmod +x ./gradlew
./gradlew bootJar
- name: web docker build and push
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -f DockerFile -t ${{ secrets.DOCKER_REPO }}/igomoney-app .
docker push ${{ secrets.DOCKER_REPO }}/igomoney-app
# docker compose up
- name: executing remote ssh commands using password
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
#password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script: |
sudo docker rm -f $(docker ps -qa)
sudo docker pull ${{ secrets.DOCKER_REPO }}/igomoney-app
docker-compose up -d
docker image prune -f