KAN-82 Add config submodule setting #8
This file contains hidden or 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: 🚀Befly API Gateway CD | |
| on: | |
| pull_request: | |
| types: [closed] | |
| branches: | |
| - develop | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Gateway Repository | |
| uses: actions/checkout@v2 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: make p12 ssl certification | |
| run: | | |
| mkdir -p src/main/resources | |
| echo "${{ secrets.P12_CERT_BASE64 }}" | base64 -d > src/main/resources/keystore.p12 | |
| - name: make application.yml | |
| run: | | |
| cd ./src/main/resources | |
| touch ./application.yml | |
| echo "${{ secrets.APPLICATION_YML }}" >> ./application.yml | |
| - name: make application-dev.yml | |
| run: | | |
| cd ./src/main/resources | |
| touch ./application-dev.yml | |
| echo "${{ secrets.APPLICATION_DEV_YML }}" >> ./application-dev.yml | |
| - name: Build with Gradle | |
| run: | | |
| chmod +x ./gradlew | |
| ./gradlew clean build -x test | |
| ls build/libs | |
| - name: Log in to Docker Hub | |
| run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin | |
| - name: Build Docker Image | |
| run: | | |
| docker build -t ${{ secrets.DOCKER_USERNAME }}/befly-gateway:latest . | |
| - name: Push to Docker Hub | |
| run: | | |
| docker push ${{ secrets.DOCKER_USERNAME }}/befly-gateway:latest | |
| - name: Connect SSH | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| username: ${{ secrets.SSH_USER }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| script: | | |
| echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin | |
| docker pull kohyunchoel/befly-gateway:latest | |
| docker stop befly-gateway || true | |
| docker rm befly-gateway || true | |
| docker run -d --name befly-gateway \ | |
| -p 443:443 \ | |
| ${{ secrets.DOCKER_USERNAME }}/befly-gateway:latest |