From 745287f5defcb9a623f728e1b7f8628f2a142869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=9E=AC=ED=95=9C?= <99114456+jaehan4707@users.noreply.github.com> Date: Sun, 21 Jul 2024 15:03:37 +0900 Subject: [PATCH] =?UTF-8?q?setting:=20job=20=EC=84=B8=EB=B6=84=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/mimo-deploy.yml | 42 +++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/.github/workflows/mimo-deploy.yml b/.github/workflows/mimo-deploy.yml index 32c4253..687ade7 100644 --- a/.github/workflows/mimo-deploy.yml +++ b/.github/workflows/mimo-deploy.yml @@ -5,46 +5,78 @@ on: branches: [ "develop" ] jobs: - build: + checkout: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3 + setup-java: + runs-on: ubuntu-latest + needs: checkout + steps: - name: Set up JDK 19 uses: actions/setup-java@v3 with: java-version: '19' distribution: 'temurin' + setup-properties: + runs-on: ubuntu-latest + needs: setup-java + steps: - name: Set up application.properties run: echo "${{ secrets.APPLICATION_PROPERTIES }}" > ./src/main/resources/application.properties + setup-maven: + runs-on: ubuntu-latest + needs: setup-properties + steps: - name: Set up Maven uses: actions/setup-java@v3 with: java-version: '19' distribution: 'temurin' cache: 'maven' - + + maven-clean: + runs-on: ubuntu-latest + needs: setup-maven + steps: - name: Clean with Maven run: mvn clean + maven-install: + runs-on: ubuntu-latest + needs: maven-clean + steps: - name: Install with Maven run: mvn install + docker-login: + runs-on: ubuntu-latest + needs: maven-install + steps: - name: Log in to Docker Hub run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin + docker-build: + runs-on: ubuntu-latest + needs: docker-login + steps: - name: Build the Docker image run: docker build -t ${{ secrets.DOCKER_REPO }} . - + + docker-push: + runs-on: ubuntu-latest + needs: docker-build + steps: - name: Push the Docker image run: docker push ${{ secrets.DOCKER_REPO }} - + deploy-ec2-server: runs-on: ubuntu-latest - needs: build + needs: docker-push steps: - name: Deploy to EC2 Server uses: appleboy/ssh-action@master