Skip to content

fix: cors 오류 해결 #18

fix: cors 오류 해결

fix: cors 오류 해결 #18

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
name: Java CI with Gradle and Redis
on:
push:
branches:
- main
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Set up NTP
run: |
sudo apt-get update
sudo apt-get install -y ntp
sudo service ntp start
- name: make application-db.yml
run: |
cd ./src/main/resources
touch ./application-db.yml
echo "${{ secrets.DB_PROPERTIES }}" > ./application-db.yml
shell: bash
- name: make application-real.yml
run: |
cd ./src/main/resources
touch ./application-real.yml
echo "${{ secrets.PROPERTIES_PROD }}" > ./application-real.yml
shell: bash
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Build with Gradle
run: ./gradlew build -x test
- name: Docker build
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -t app -f Dockerfile .
docker tag app ${{ secrets.DOCKER_USERNAME }}/bapmate:latest
docker push ${{ secrets.DOCKER_USERNAME }}/bapmate:latest
- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST_PROD }} # EC2 인스턴스 퍼블릭 DNS
username: ubuntu
key: ${{ secrets.PRIVATE_KEY }} # pem 키
# 도커 작업
script: |
docker pull ${{ secrets.DOCKER_USERNAME }}/bapmate:latest
docker stop $(docker ps -a -q)
docker-compose up -d
docker image prune -a -f