style: refreshToken entity 정리 #1
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: gojip cicd | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# yml 생성 | |
- name: make application | |
run: | | |
cd ./src/main/resources | |
touch application-credentials.yml | |
touch application-aws.yml | |
touch application-rds.yml | |
echo "${{ secrets.CREDENTIALS_YML }}" > application-credentials.yml | |
echo "${{ secrets.AWS_YML }}" > application-aws.yml | |
echo "${{ secrets.RDS_YML }}" > application-rds.yml | |
echo "${{ secrets.PROD_YML }}" > application-prod.yml | |
shell: bash | |
# open jdk 17 버전 환경을 세팅 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: "adopt" | |
# gradle을 통해 소스를 빌드. | |
- name: Build with Gradle | |
run: | | |
chmod +x ./gradlew | |
./gradlew clean | |
./gradlew bootjar | |
- name: Docker build | |
run: | | |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | |
docker build -t ${{ secrets.DOCKER_USERNAME }}/gojip_server:0.1 . | |
docker push ${{ secrets.DOCKER_USERNAME }}/gojip_server:0.1 | |
- name: Deploy to server with docker-compose | |
uses: appleboy/ssh-action@master | |
id: deploy | |
with: | |
host: ${{ secrets.HOST }} | |
username: ec2-user | |
key: ${{ secrets.KEY }} | |
envs: GITHUB_SHA | |
script: | | |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | |
docker rm -f $(docker ps -qa) | |
docker rmi ${{ secrets.DOCKER_USERNAME }}/gojip_server:0.1 | |
docker pull ${{ secrets.DOCKER_USERNAME }}/gojip_server:0.1 | |
docker-compose up -d | |