feat: 외부 결제 모듈 연동 (#91) #26
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: DEV CD | |
on: | |
push: | |
branches: [ "develop" ] | |
jobs: | |
CI: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'corretto' | |
- name: create secret config file | |
run: | | |
cd src/main/resources | |
echo "${{ secrets.APPLICATION_YML_DEV }}" > ./application-dev.yml | |
- name: Cache Gradle packages | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
gradle-${{ runner.os }}- | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew clean build | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Login to Docker Hub | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./Dockerfile-dev | |
push: true | |
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DEV_REPONAME }} | |
CD: | |
needs: [CI] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Docker Image Pull and Container Run | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.DEV_SERVER_HOST }} | |
username: ${{ secrets.DEV_USERNAME }} | |
key: ${{ secrets.DEV_SERVER_KEY }} | |
script: | | |
cd ~ | |
./deploy.sh |