builc ci에 env 설정 코드를 추가한다 #33
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: Build & Unit Test | |
on: | |
push: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set JDK to 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "temurin" | |
java-version: "17" | |
java-package: jdk | |
architecture: x64 | |
cache: 'gradle' | |
- name: Set Yaml | |
uses: microsoft/variable-substitution@v1 | |
with: | |
files: ./api/src/main/resources/application.yaml | |
env: | |
spring.datasource.url: ${{ secrets.DB_URL }} | |
spring.datasource.username: ${{ secrets.DB_USER_NAME }} | |
spring.datasource.password: ${{ secrets.DB_USER_PASSWORD }} | |
oauth.kakao.client-id: ${{ secrets.KAKAO_CLIENT_ID }} | |
jwt.secret-key: ${{ secrets.SECRET_KEY }} | |
- name: Build with Gradle | |
run: | | |
./gradlew clean build | |
- name: Docker Image Build | |
run: docker build -t anwjdrbs123/tag-wonder-api-ci . | |
- name: Docker Login | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USER_NAME }} | |
password: ${{ secrets.DOCKER_USER_ACCESS_TOKEN }} | |
- name: Docker Hub Push | |
run: docker push anwjdrbs123/tag-wonder-api-ci |