Skip to content

[deploy] 새롭게 반영된 사항 적용해서 배포합니다 (#164) #9

[deploy] 새롭게 반영된 사항 적용해서 배포합니다 (#164)

[deploy] 새롭게 반영된 사항 적용해서 배포합니다 (#164) #9

Workflow file for this run

name: DEPLOY
on:
push:
branches:
- release/**
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Jdk 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Debug Secrets
run: |
echo "Secrets YML value:"
echo "${{ secrets.PROD_CONFIG }}"
- name: Push yml file
run: |
mkdir -p ./src/main/resources
cat <<EOF > ./src/main/resources/application-prod.yml
${{ secrets.PROD_CONFIG }}
EOF
echo "YML file successfully created"
- name: Build with Gradle
run: ./gradlew -x test clean build
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and Push Docker Image
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/ggang:latest .
docker push ${{ secrets.DOCKER_USERNAME }}/ggang:latest
- name: deploy appleboy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.PORT }}
script: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }}
docker pull ${{ secrets.DOCKER_USERNAME }}/ggang:latest
./deploy.sh
echo "now finished deploy: $(date '+%Y-%m-%d %H:%M:%S')" > deploy_success_date.txt