fix :: add missing response (dto) #157
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: GitHub CI with Gradle | |
on: [ push ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout to develop | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref }} | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'corretto' | |
- name: Create secured configurations | |
run: | | |
touch ./src/main/resources/palette.p12 | |
echo '${{ secrets.PALETTE_P12 }}' | base64 --decode > ./src/main/resources/palette.p12 | |
- name: Build with Gradle | |
run: | | |
chmod +x gradlew | |
./gradlew build | |
- name: Set up QEMU | |
if: github.ref == 'refs/heads/main' | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
if: github.ref == 'refs/heads/main' | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
if: github.ref == 'refs/heads/main' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and push by digest | |
if: github.ref == 'refs/heads/main' | |
id: build | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_IMAGE_NAME }}:latest | |
file: Dockerfile | |
context: . | |
publish: | |
if: ${{ always() && contains(join(needs.*.result, ','), 'success') && github.ref == 'refs/heads/main' }} | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Add to Docker | |
uses: appleboy/ssh-action@v1.0.3 | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
port: ${{ secrets.SSH_PORT }} | |
script: | | |
docker stop $(docker ps -aq -f 'ancestor=${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_IMAGE_NAME }}') | |
docker rm $(docker ps -aq -f 'ancestor=${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_IMAGE_NAME }}') | |
docker pull ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_IMAGE_NAME }}:latest | |
touch ./production.env | |
echo '${{ secrets.ROUTE_ENVIRONMENT }}' | base64 --decode > ./production.env | |
docker run --env-file production.env -d -p 8080:8080 --name route ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_IMAGE_NAME }} | |
rm ./production.env |