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