#113 - feat: 방장 권한 커스텀 어노테이션 처리 #115
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: | |
push: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
- name: make application-dev.yml | |
run: | | |
cd ./src/main/resources | |
touch ./application-dev.yml | |
echo "${{ secrets.APPLICATION_DEV }}" > ./application-dev.yml | |
touch ./application.yml | |
echo "${{ secrets.APPLICATION_YML }}" > ./application.yml | |
cd ../../test/resources | |
touch ./application.yml | |
echo "${{ secrets.APPLICATION_YML }}" > ./application.yml | |
- name: create-json | |
id: create-json | |
uses: jsdaniell/[email protected] | |
with: | |
name: "dodal-fcm.json" | |
json: ${{ secrets.FCM_JSON }} | |
dir: src/main/resources | |
- name: Build with Gradle | |
run: | | |
./gradlew cleanQuerydslSourceDir | |
./gradlew build | |
- name: docker build and push | |
run: | | |
docker login -u ${{ secrets.DOCKER_USERNAME}} -p ${{ secrets.DOCKER_PASSWORD }} | |
docker build -t ${{ secrets.DOCKER_REPO }}/dodal . | |
docker push ${{ secrets.DOCKER_REPO }}/dodal | |
- name: ec2 remote ssh and command by appleboy | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.EC2_HOST }} | |
username: ubuntu | |
key: ${{ secrets.EC2_KEY }} | |
script: | | |
sudo docker pull ${{ secrets.DOCKER_REPO }}/dodal | |
sudo docker stop $(sudo docker ps -qa) | |
sudo docker image prune -a -f | |
sudo docker-compose -f /docker/docker-compose-${{ secrets.SERVER_PROFILE}}.yml down --rmi all | |
sudo docker-compose -f /docker/docker-compose-${{ secrets.SERVER_PROFILE}}.yml up -d |