Skip to content

Merge pull request #187 from hseong3243/feat/pagination #1

Merge pull request #187 from hseong3243/feat/pagination

Merge pull request #187 from hseong3243/feat/pagination #1

Workflow file for this run

name: CD
on:
push:
branches: [ "hseong3243" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{secrets.ACTION_TOKEN}}
submodules: true
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Build with Gradle
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with:
arguments: build
- name: Build and save Docker image
run: |
docker build -t jsp-cafe:${{ github.sha }} .
docker save -o jsp-cafe.tar jsp-cafe:${{ github.sha }}
chmod 664 jsp-cafe.tar
- name: copy file via ssh password
uses: appleboy/[email protected]
with:
host: ${{ secrets.AWS_HOST }}
username: ${{ secrets.AWS_USERNAME }}
key: ${{ secrets.AWS_PRIVATE_KEY }}
source: "jsp-cafe.tar"
target: "/home/ubuntu"
- name: executing remote ssh commands using password
uses: appleboy/[email protected]
with:
username: ${{ secrets.AWS_USERNAME }}
host: ${{ secrets.AWS_HOST }}
key: ${{ secrets.AWS_PRIVATE_KEY }}
script: |
docker stop $(docker ps -a -q) || true
docker rmi $(docker images -q)
docker load -i jsp-cafe.tar
docker run -d -p 8080:8080 --add-host=host.docker.internal:host-gateway jsp-cafe:${{ github.sha }}
rm jsp-cafe.tar