Skip to content

Commit

Permalink
[STMT-6] 👷 CI-CD workflow 수정 - 환경변수 설정 (#17) (#18)
Browse files Browse the repository at this point in the history
- 파일 이름 변경
 - github-actions.yml -> ci-cd.yml
- gitignore에 application-secret.properties 파일 추가

Co-authored-by: zxcv9203 <[email protected]>
  • Loading branch information
05AM and zxcv9203 authored Feb 15, 2024
1 parent 0609dc6 commit f96a69a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
name: CI/CD using github actions & docker

# event trigger
# main 브랜치에 push가 되었을 때 실행
on:
push:
branches:
Expand All @@ -16,14 +15,23 @@ jobs:
runs-on: ubuntu-latest
steps:

# JDK setting - github actions에서 사용할 JDK 설정
# JDK setting
- name: Checkout
- uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- name: set environment variables
working-directory: ./
run: |
pwd
touch src/main/resources/application-secret.properties
echo ${{ secrets.ENV }} >> src/main/resources/application-secret.properties
# gradle caching - 빌드 시간 향상
- name: Gradle Caching
uses: actions/cache@v3
Expand All @@ -35,7 +43,6 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
# docker login
- name: Login to Docker Hub
uses: docker/login-action@v1
Expand Down Expand Up @@ -66,5 +73,4 @@ jobs:
sudo docker stop stumeet-server
docker container prune -f
sudo docker run -it -d -p 8080:8080 --name stumeet-server ${{ secrets.DOCKER_USERNAME }}/server
sudo docker image prune -f
sudo docker image prune -f
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ out/

### VS Code ###
.vscode/

application-secret.properties

0 comments on commit f96a69a

Please sign in to comment.