feat: 다른 유저 정보 조회 시, 로그인 유저가 현재 팔로우 중인지 나타내는 필드 추가 (#61) #43
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: CD using Github Actions and Docker | |
on: | |
push: | |
branches: | |
- master | |
- develop-backend | |
permissions: | |
contents: read | |
jobs: | |
CI-CD: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Gradle Caching | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: make application.yml | |
if: | | |
contains(github.ref, 'master') || | |
contains(github.ref, 'develop-backend') | |
run: | | |
cd ./backend/src/main/resources | |
touch ./application.yml | |
echo "${{ secrets.YML }}" > ./application.yml | |
shell: bash | |
- name: Grant execute permission for gradlew | |
run: chmod +x ./gradlew | |
working-directory: ./backend/ | |
- name: Build with Gradle | |
run: ./gradlew build -x test | |
working-directory: ./backend/ | |
- name: Docker build & push to dev | |
if: | | |
contains(github.ref, 'master') || | |
contains(github.ref, 'develop-backend') | |
run: | | |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | |
docker build -t ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }} ./backend/ | |
docker images | |
docker push ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }} | |
- name: Deploy to dev | |
uses: appleboy/ssh-action@master | |
id: deploy-dev | |
if: | | |
contains(github.ref, 'master') || | |
contains(github.ref, 'develop-backend') | |
with: | |
host: ${{ secrets.HOST_DEV }} | |
username: ${{ secrets.USERNAME }} | |
port: 22 | |
key: ${{ secrets.PRIVATE_KEY }} | |
script: | | |
cd ~/Gobong/backend/ | |
sudo docker ps | |
sudo docker pull ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }} | |
sudo docker rm -f $(sudo docker ps -qa) | |
sudo docker-compose up -d | |
sudo docker image prune -f |