Fix/346 : 쿠키 Path 설정 #16
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
# This workflow will build a Java project with Maven, 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-maven | |
# 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. | |
name: Java CI with Maven | |
on: | |
push: | |
branches: [ "dev-be" ] | |
pull_request: | |
branches: [ "dev-be" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
working-directory: ./server/collusic-be | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
working-directory: ./server/collusic-be | |
- name: Build with Gradle | |
run: ./gradlew build | |
working-directory: ./server/collusic-be | |
env: | |
JASYPT_PASSWORD: ${{ secrets.JASYPT_PASSWORD }} | |
## 이미지 빌드 및 도커허브에 push | |
- name: docker build and push | |
working-directory: ./server/collusic-be | |
env: | |
JASYPT_PASSWORD: ${{ secrets.JASYPT_PASSWORD }} | |
run: | | |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | |
docker build -f Dockerfile-prod -t ${{ secrets.DOCKER_REPO }}/collusic-api . | |
docker push ${{ secrets.DOCKER_REPO }}/collusic-api | |
## docker compose up | |
- name: executing remote ssh commands using password | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ubuntu | |
key: ${{ secrets.SSH_KEY }} | |
port: 22 | |
script: | | |
sudo docker rm -f $(docker ps -aq) | |
sudo docker rmi `docker images -a -q` | |
cd app | |
rm -rf docker-compose.yml | |
touch ./docker-compose.yml | |
echo "${{ secrets.DOCKER_COMPOSE }}" >> ./docker-compose.yml | |
export JASYPT_PASSWORD=${{ secrets.JASYPT_PASSWORD }} | |
docker-compose up -d | |
docker image prune -f |