Skip to content

Merge pull request #45 from MOONSHOT-Team/feature/#42 #18

Merge pull request #45 from MOONSHOT-Team/feature/#42

Merge pull request #45 from MOONSHOT-Team/feature/#42 #18

Workflow file for this run

name: CD
on:
push:
branches: [ "develop" ]
jobs:
deploy-ci:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
- name: application.yaml 생성
run: |
cd src/main/resources
echo "${{ secrets.APPLICATION }}" > ./application-deploy.yaml
- name: build
run: |
chmod +x gradlew
./gradlew build -x test
shell: bash
- name: docker build setting
uses: docker/setup-buildx-action@v2.9.1
- name: docker hub login
uses: docker/login-action@v2.2.0
with:
username: ${{ secrets.DOCKERHUB_LOGIN_USERNAME }}
password: ${{ secrets.DOCKERHUB_LOGIN_ACCESSTOKEN }}
- name: docker image build and push
run: |
docker build --platform linux/amd64 -t teammoonshot/server .
docker push teammoonshot/server
deploy-cd:
needs: deploy-ci
runs-on: ubuntu-22.04
steps:
- name: docker container running
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.RELEASE_SERVER_IP }}
username: ${{ secrets.RELEASE_SERVER_USER }}
key: ${{ secrets.RELEASE_SERVER_KEY }}
script: |
cd ~
./deploy.sh