Skip to content

Commit

Permalink
Merge pull request #2 from goormthon-Univ/develope
Browse files Browse the repository at this point in the history
Chore : Create a keystore secret key before building docker
  • Loading branch information
Sirius506775 authored Mar 17, 2024
2 parents b9132ac + ed46133 commit 9e55bd9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ scripts

README.md

/src/main/resources/application-secret.yml
/src/main/resources/application.tar
/src/test/
21 changes: 21 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
branches:
- main

env:
RESOURCE_PATH: /home/runner/work/2024_BEOTKKOTTHON_TEAM_32_BE/2024_BEOTKKOTTHON_TEAM_32_BE/src/main/resources

permissions:
contents: read
checks: write
Expand All @@ -29,9 +32,27 @@ jobs:
- name: Make gradlew executable
run: chmod +x ./gradlew

# Decrypt the encrypted application-secret.yml file
- name: Decrypt application-prod yml
run: gpg --quiet --batch --yes --always-trust --decrypt --passphrase=${{ secrets.APPLICATION_PROD_YML }} --output $RESOURCE_PATH/application.tar $RESOURCE_PATH/application.tar.gpg
shell: bash

# Unzip the application.tar file
- name: Unzip application.tar file to application-prod.yml
run: |
cd $RESOURCE_PATH
tar xvf application.tar
shell: bash

- name: Build with Gradle
run: ./gradlew build -x test

- name: Prepare keystore
run: echo "${{ secrets.KEYSTORE }}" > keystore.p12

- name: Move keystore file to Docker build context
run: mv keystore.p12 src/main/resources/

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

Expand Down
Binary file added src/main/resources/application.tar.gpg
Binary file not shown.

0 comments on commit 9e55bd9

Please sign in to comment.