jib 1차 속도테스트 #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD Pipeline | |
on: | |
push: | |
branches: | |
- dev | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
# - name: Cache Gradle packages | |
# uses: actions/cache@v3 | |
# with: | |
# path: ~/.gradle/caches | |
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
# restore-keys: | | |
# ${{ runner.os }}-gradle- | |
# - name: Cache Docker layers | |
# uses: actions/cache@v3 | |
# with: | |
# path: /home/runner/.cache/docker | |
# key: ${{ runner.os }}-docker-${{ github.sha }} | |
# restore-keys: | | |
# ${{ runner.os }}-docker- | |
- name: Docker Hub login | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build with Jib | |
run: ./gradlew jib --image=jsangmin00/want_project:latest | |
# deploy: | |
# runs-on: ubuntu-latest | |
# needs: build | |
# | |
# steps: | |
# - name: SSH to EC2 | |
# uses: appleboy/[email protected] | |
# with: | |
# host: ${{ secrets.EC2_HOST }} | |
# username: ubuntu | |
# key: ${{ secrets.EC2_SSH_KEY }} | |
# port: 22 | |
# script: | | |
# cd ~/want | |
# if ! type docker > /dev/null; then | |
# sudo snap install docker || echo "docker install failed" | |
# else | |
# echo "docker is already installed" | |
# fi | |
# sudo docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | |
# chmod +x deploy.sh | |
# ./deploy.sh jsangmin00/want_project:latest |