Skip to content

Commit

Permalink
setting: job 세분화
Browse files Browse the repository at this point in the history
  • Loading branch information
jaehan4707 authored Jul 21, 2024
1 parent 04d87c7 commit 745287f
Showing 1 changed file with 37 additions and 5 deletions.
42 changes: 37 additions & 5 deletions .github/workflows/mimo-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 745287f

Please sign in to comment.