Skip to content

fix: dockerfile 수정 #11

fix: dockerfile 수정

fix: dockerfile 수정 #11

Workflow file for this run

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Java CI with Gradle
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker
uses: docker/setup-buildx-action@v3
- name: Login to ghcr
uses: docker/login-action@v3
with:
registry: ghcr.io
username: yunuo46
password: ${{ secrets.GHCR_TOKEN }}
- name: docker Build and Push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ghcr.io/yunuo46/getaguitar:latest
deploy-docker:
needs: build-docker
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: SSH Version Check
run: ssh -V
- name: Deploy to Server via SSH
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u yunuo46 --password-stdin
docker pull ghcr.io/yunuo46/getaguitar:latest
docker stop getaguitar || true
docker rm getaguitar || true
docker run -d --name getaguitar -p 3000:3000 ghcr.io/yunuo46/getaguitar:latest