Skip to content

Merge pull request #82 from grida-diary/main #23

Merge pull request #82 from grida-diary/main

Merge pull request #82 from grida-diary/main #23

Workflow file for this run

name: deploy grida apis
on:
push:
branches: [ "prod" ]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: setup java
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
- name: login docker
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_EMAIL }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: clean gradle projects
run: ./gradlew grida-core:core-api:clean
- name: build core api
run: ./gradlew grida-core:core-api:build
- name: docker build and push to hub sso-application
uses: docker/build-push-action@v3
with:
context: ./grida-core/core-api
file: ./grida-core/core-api/Dockerfile
push: true
tags: wwan13/grida-core-api:prod
- name: deploy to aws instance
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USERNAME }}
key: ${{ secrets.REMOTE_PRIVATE_KEY }}
port: 22
script: |
sudo ./remote/scripts/deploy.sh