-
Notifications
You must be signed in to change notification settings - Fork 1
105 lines (105 loc) · 3.38 KB
/
cd-dev.yml
File metadata and controls
105 lines (105 loc) · 3.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#name: CD - Dev
#
#on:
# workflow_dispatch:
#
#jobs:
# build:
# name: build
# runs-on: ubuntu-latest
# outputs:
# docker_image_tag: ${{ steps.set_tag.outputs.docker_image_tag }}
# steps:
# - name: Discord Notification
# env:
# DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }}
# uses: Ilshidur/action-discord@master
# with:
# args:
# '🚀 CD - Dev workflow 실행됨 Triggered by: **${{ github.actor }}**'
#
# # 코드 체크아웃
# - name: Checkout repository
# uses: actions/checkout@v2
# with:
# fetch-depth: 0
#
# # JDK 설치
# - name: Set up JDK 17
# uses: actions/setup-java@v1
# with:
# java-version: 17
#
# # secret 파일 불러오기
# - name: make secret files
# run: |
# mkdir -p ./src/main/resources
# echo "${{ secrets.APPLICATION_YML }}" > ./src/main/resources/application.yml
# echo "${{ secrets.FIREBASE_JSON }}" | base64 -d > ./src/main/resources/weathertago-17db0-firebase-adminsdk-fbsvc-762577f71f.json
# echo "${{ secrets.APPLICATION_API_KEY_PROPERTIES }}" > ./src/main/resources/application-API-KEY.properties
#
# # Gradle Build
# - name: Build with Gradle
# run: |
# sudo chmod +x ./gradlew
# sudo ./gradlew clean build
#
# # 날짜 기반 태그 생성
# - name: Set Docker image tag
# id: set_tag
# run: |
# export TZ=Asia/Seoul
# echo "docker_image_tag=$(date +'%Y%m%d-%H%M')" >> $GITHUB_OUTPUT
#
# - name: Export Docker tag
# id: export_tag
# run: echo "docker_image_tag=$(echo '${{ steps.meta.outputs.tags }}' | cut -d ':' -f2)" >> $GITHUB_OUTPUT
#
# # DockerHub 로그인
# - name: Login to DockerHub
# uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKER_HUB_USERNAME }}
# password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
#
# # DockerHub Push
# - name: Build and Push Docker image
# run: |
# docker build --no-cache -t ${{ secrets.DOCKER_HUB_USERNAME }}/weathertago:${{ steps.set_tag.outputs.docker_image_tag }} .
# docker push ${{ secrets.DOCKER_HUB_USERNAME }}/weathertago:${{ steps.set_tag.outputs.docker_image_tag }}
#
#
# deploy:
# name: Deploy
# runs-on: ubuntu-latest
# needs: build
#
# steps:
# # AWS 배포
# - name: SSH to EC2 and deploy
# uses: appleboy/ssh-action@v1.2.0
# with:
# host: ${{ secrets.EC2_HOST }}
# username: ${{ secrets.EC2_USER }}
# key: ${{ secrets.EC2_SSH_KEY }}
# script: |
# cd backend
# git pull
# echo "TAG=${{ needs.build.outputs.docker_image_tag }}" > .env
# sudo docker compose stop weathertago-app
# sudo docker compose rm -f weathertago-app
# sudo docker rmi ${{ secrets.DOCKER_HUB_USERNAME }}/weathertago:$TAG || true
# sudo docker compose pull weathertago-app
# sudo docker compose up -d weathertago-app --no-deps
# env:
# ACTIONS_RUNNER_DEBUG: true
#
#
# - name: Discord Notification
# env:
# DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }}
# uses: Ilshidur/action-discord@master
# with:
# args:
# '😎 배포 완료됨 Triggered by: **${{ github.actor }}**'
#