Skip to content

Commit

Permalink
Merge pull request #153 from JNU-econovation/infra
Browse files Browse the repository at this point in the history
[INFRA] 인스턴스 시간 설정
  • Loading branch information
capDoYeonLee authored Oct 20, 2023
2 parents fba1450 + b759910 commit 49425d4
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:
pull_request:
branches: [ "develop","be" ]
workflow_dispatch:
# GitHub Action Run workflow 가능하게 해주는 명령어

permissions:
contents: read
Expand Down Expand Up @@ -56,7 +55,6 @@ jobs:
version: v0.7.0

## docker build & push to develop
# DOCKER_USERNAME DOCKER_PASSWORD DOCKER_REPO
- name: Docker build & push to dev
working-directory: ./be/overflow
if: contains(github.ref, 'develop')
Expand All @@ -65,11 +63,9 @@ jobs:
docker build -t ${{ secrets.DOCKER_REPO }}/ecnv-overflow .
docker push ${{ secrets.DOCKER_REPO }}/ecnv-overflow
# docker build -f Dockerfile -t ${{ secrets.DOCKER_REPO }}/ecnv-overflow .
# docker build -t ${{ secrets.DOCKER_REPO }}/ecnv-overflow .
## deploy to develop
# HOST_DEV USERNAME PASSWORD
- name: Deploy to dev
uses: appleboy/ssh-action@master
id: deploy-dev
Expand All @@ -79,11 +75,25 @@ jobs:
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: 22
#key: ${{ secrets.PRIVATE_KEY }}
working-directory: ./be/overflow
script: |
sudo usermod -a -G docker $USER
sudo docker pull ${{ secrets.DOCKER_REPO }}/ecnv-overflow
docker-compose up -d
docker image prune -f
## time
current-time:
needs: CI-CD
runs-on: ubuntu-latest
steps:
- name: Get Current Time
uses: 1466587594/get-current-time@v2
id: current-time
with:
format: YYYY-MM-DDTHH:mm:ss
utcOffset: "+09:00" # 기준이 UTC이기 때문에 한국시간인 KST를 맞추기 위해 +9시간 추가

- name: Print Current Time
run: echo "Current Time=${{steps.current-time.outputs.formattedTime}}" # current-time 에서 지정한 포맷대로 현재 시간 출력
shell: bash

0 comments on commit 49425d4

Please sign in to comment.