Skip to content

πŸ”— :: (809) λͺ¨μ§‘μ˜λ’°μ„œ μƒνƒœ λ³€κ²½ μŠ€μΌ€μ€„λŸ¬ μˆ˜μ • #303

πŸ”— :: (809) λͺ¨μ§‘μ˜λ’°μ„œ μƒνƒœ λ³€κ²½ μŠ€μΌ€μ€„λŸ¬ μˆ˜μ •

πŸ”— :: (809) λͺ¨μ§‘μ˜λ’°μ„œ μƒνƒœ λ³€κ²½ μŠ€μΌ€μ€„λŸ¬ μˆ˜μ • #303

Workflow file for this run

name: dev-cd
on:
push:
branches:
- develop
jobs:
build:
environment: dev
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'zulu'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew --build-cache build
- name: Login to Dockerhub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker Build
run: docker build -t jobis1111/dev-server .
- name: Push on Dockerhub
run: docker push jobis1111/dev-server
- name: Connect EC2 & Deploy Docker Image
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST }}
port: ${{ secrets.EC2_PORT }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.EC2_KEY }}
script: |
cd jobis
docker pull jobis1111/dev-server
docker compose up -d --no-deps --build dev-server
docker image prune -a -f