refactoring #19
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 to Amazon EC2 | |
on: | |
push: | |
branches: [ "develop" ] | |
jobs: | |
deploy: | |
name: deploy | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
- name: setting-jdk17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'zulu' | |
- name: checkout | |
uses: actions/checkout@v2 | |
# | |
# - name: test | |
# run: ./gradlew clean test | |
- name : build | |
run: ./gradlew build -x test | |
- name: copy file to Develop server via ssh key | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.AWS_HOST }} | |
username: ${{ secrets.AWS_USERNAME }} | |
key: ${{ secrets.AWS_SSH_KEY }} | |
source: "build/libs/*" | |
target: "/home/ubuntu/apiserver" | |
- name: deploy | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.AWS_HOST }} | |
username: ${{ secrets.AWS_USERNAME }} | |
key: ${{ secrets.AWS_SSH_KEY }} | |
script: | | |
sudo systemctl restart apiserver.service |