fix: cash 생성 시 readonly로 되어있어서 생성 안되는 문제 해결 #10
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: Java CI with Gradle | |
on: | |
pull_request: | |
types: [closed] | |
branches: [ "develop" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
# Configure Gradle for optimal use in GiHub Actions, including caching of downloaded dependencies. | |
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 | |
## create application-prod.yml | |
- name: make application-prod.yml | |
run: | | |
mkdir -p ./src/main/resources | |
cd ./src/main/resources | |
touch ./application.yml | |
echo '${{ secrets.PROPERTIES_PROD }}' > ./application.yml | |
shell: bash | |
## grant execute permission for gradlew | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle Wrapper | |
run: ./gradlew build -x test | |
## docker build & push to production | |
- name: Docker build & push to prod | |
run: | | |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD}} | |
docker build -t ${{ secrets.DOCKER_USERNAME }}/payment . | |
docker push ${{ secrets.DOCKER_USERNAME }}/payment | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
## deploy to production | |
- name: Deploy to prod | |
uses: appleboy/ssh-action@master | |
id: deploy-prod | |
with: | |
host: ${{ secrets.HOST_EC2 }} # EC2 퍼블릭 IPv4 DNS | |
username: ubuntu | |
key: ${{ secrets.PRIVATE_KEY }} | |
envs: GITHUB_SHA | |
script: | | |
sudo docker stop mfc-payment | |
sudo docker rm mfc-payment | |
sudo docker pull ${{ secrets.DOCKER_USERNAME }}/payment | |
sudo docker run -d --name mfc-payment --network mfc -P ${{ secrets.DOCKER_USERNAME }}/payment | |
sudo docker image prune -f |