From cca7dda05ecb056abae69408102c93839b498d49 Mon Sep 17 00:00:00 2001 From: MinchoGreenT Date: Thu, 14 Mar 2024 03:01:32 +0900 Subject: [PATCH] =?UTF-8?q?dev-cicd.yml=20deploy=20job=20environment=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev-ci.yml | 49 +++++++++++++++++++--------------- .github/workflows/dev-cicd.yml | 1 + 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/.github/workflows/dev-ci.yml b/.github/workflows/dev-ci.yml index 0e0a5e95..f24d3252 100644 --- a/.github/workflows/dev-ci.yml +++ b/.github/workflows/dev-ci.yml @@ -12,34 +12,39 @@ jobs: contents: read steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' - - name: Copy application.yml - env: - OCCUPY_DEPLOY: $OCCUPY_DEPLOY - OCCUPY_DB: $OCCUPY_DB - OCCUPY_AWS: $OCCUPY_AWS - run: | + - name: Copy application.yml + env: + OCCUPY_DEPLOY: ${{ secrets.OCCUPY_DEPLOY }} + OCCUPY_DB: ${{ secrets.OCCUPY_DB }} + OCCUPY_AWS: ${{ secrets.OCCUPY_AWS }} + run: | cd ./src/main/resources touch ./application.yml echo "$OCCUPY_DEPLOY" > ./application.yml touch ./application-db.yml - echo "$OCCUPY_DEPLOY" > ./application-db.yml + echo "$OCCUPY_DB" > ./application-db.yml touch ./application-aws.yml - echo "$OCCUPY_DEPLOY" > ./application-aws.yml - - - name: Build with Gradle - uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 - with: - arguments: clean build + echo "$OCCUPY_AWS" > ./application-aws.yml - - name: Docker build & push to dockerhub - run: | - docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD + - name: Build with Gradle + uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 + with: + arguments: clean build + + - name: Login to DockerHub + uses: docker/login-action@v3.0.0 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Docker build & push to dockerhub + run: | docker build -f Dockerfile -t minchogt/farmus-spring . docker push minchogt/farmus-spring \ No newline at end of file diff --git a/.github/workflows/dev-cicd.yml b/.github/workflows/dev-cicd.yml index d8b3c24c..9a1bda6a 100644 --- a/.github/workflows/dev-cicd.yml +++ b/.github/workflows/dev-cicd.yml @@ -53,6 +53,7 @@ jobs: deploy: needs: build runs-on: ubuntu-latest + environment: dev steps: - name: Setup SSH uses: webfactory/ssh-agent@v0.5.4