Skip to content

Update CI-MAIN.yml

Update CI-MAIN.yml #3

Workflow file for this run

name: CI
on:
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-22.04
env:
working-directory: neighbor
steps:
- name: ์ฒดํฌ์•„์›ƒ
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3

Check failure on line 18 in .github/workflows/CD-MAIN.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/CD-MAIN.yml

Invalid workflow file

You have an error in your yaml syntax on line 18
with:
distribution: 'corretto'
java-version: '17'
- name: application-prod.yaml ์ƒ์„ฑ
run: |
cd src/main/resources
echo "${{ secrets.APPLICATION_PROD }}" > ./application-prod.yaml
working-directory: ${{ env.working-directory }}
- name: ๋นŒ๋“œ
run: |
chmod +x gradlew
./gradlew build -x test
working-directory: ${{ env.working-directory }}
shell: bash
######## ์—ฌ๊ธฐ๊นŒ์ง€๋Š” CI.yaml์™€ ๋™์ผํ•จ. CI๊ณผ์ •์— ๋‚˜์ค‘์— ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ํ›„ ํ…Œ์ŠคํŠธ ๋นŒ๋“œ๊ณผ์ • ์ถ”๊ฐ€ํ•ด๋ณด์ž. #########
- name: docker build ๊ฐ€๋Šฅํ•˜๋„๋ก ํ™˜๊ฒฝ ์„ค์ •
uses: docker/[email protected]
- name: docker hub์—๋กœ๊ทธ์ธ
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_LOGIN_USERNAME }}
password: ${{ secrets.DOCKERHUB_LOGIN_ACCESSTOKEN }}
- name: docker image ๋นŒ๋“œ ๋ฐ ํ‘ธ์‹œ
run: |
docker build --platform linux/amd64 -t sss4920/neighbor .
docker push sss4920/neighbor
working-directory: ${{ env.working-directory }}
deploy-cd:
needs: deploy-ci
runs-on: ubuntu-22.04
steps:
- name: ๋„์ปค ์ปจํ…Œ์ด๋„ˆ ์‹คํ–‰
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.RELEASE_SERVER_IP }}
username: ${{ secrets.RELEASE_SERVER_USER }}
key: ${{ secrets.RELEASE_SERVER_KEY }}
script: |
docker rm -f neighbor
docker image pull sss4920/neighbor
docker run -d --name neighbor-8080 -p 8080:8080 sss4920/neighbor