Skip to content

fix/#604 : devWorkflow.yml의 ci가 opened, edited 상태일 때 샐행되도록 수정 #11

fix/#604 : devWorkflow.yml의 ci가 opened, edited 상태일 때 샐행되도록 수정

fix/#604 : devWorkflow.yml의 ci가 opened, edited 상태일 때 샐행되도록 수정 #11

Workflow file for this run

name: testAndDeploy_dev
on:
pull_request:
types:
- [opened, edited]
branches:
- develop
jobs:
build:
runs-on: ubuntu-22.04
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Cache Gradle
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: Build with Gradle Wrapper
run: ./gradlew build
- name: Jacoco Report to PR
id: jacoco
uses: madrapps/[email protected]
with:
paths: ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
# - name: Send docker-compose.yml
# uses: appleboy/scp-action@master
# with:
# host: ${{ secrets.SSH_HOST }}
# username: ${{ secrets.SSH_USERNAME }}
# key: ${{ secrets.SSH_KEY }}
# source: ./docker-compose.yml
# target: /home/ubuntu/backend-deploy
#
# - name: Send resources-develop-environment
# uses: appleboy/scp-action@master
# with:
# host: ${{ secrets.SSH_HOST }}
# username: ${{ secrets.SSH_USERNAME }}
# key: ${{ secrets.SSH_KEY }}
# source: ./resources/gaebaljip-develop-environment
# target: /home/ubuntu/backend-deploy
#
# - name: Create .env file
# run: |
# echo "${{ secrets.ENV_VARS }}" > .env
#
# - name: Send env file
# uses: appleboy/scp-action@master
# with:
# host: ${{ secrets.SSH_HOST }}
# username: ${{ secrets.SSH_USERNAME }}
# key: ${{ secrets.SSH_KEY }}
# source: ./.env
# target: /home/ubuntu/backend-deploy
#
# - name: Docker Image Build
# run: docker build -t ${{ secrets.DOCKER_HUB_USER_NAME }}/gaebaljip-dev:latest .
#
# - name: Docker Hub Login
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKER_HUB_USER_NAME }}
# password: ${{ secrets.DOCKER_HUB_TOKEN }}
#
# - name: docker Hub Push
# run: docker push ${{ secrets.DOCKER_HUB_USER_NAME }}/gaebaljip-dev:latest
#
# - name: SSH Deploy
# uses: appleboy/[email protected]
# with:
# host: ${{ secrets.SSH_HOST }}
# username: ${{ secrets.SSH_USERNAME }}
# key: ${{ secrets.SSH_KEY }}
# script: |
# cd backend-deploy/BE/exceed
# sudo docker-compose down
# sudo docker pull ${{ secrets.DOCKER_HUB_USER_NAME }}/gaebaljip-dev:latest
# sudo docker-compose up --build -d
# sudo docker image prune -a -f
#
#