Merge pull request #102 from grida-diary/main #26
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: 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 |