Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/deploy-single-server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Deploy to Single Server

on:
push:
branches:
- 'main'
workflow_dispatch:

env:
IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/cicd-practice
IMAGE_TAG: latest
CONTAINER_NAME: ${{ secrets.DOCKERHUB_USERNAME }}-cicd
PORT: 40003

jobs:
cicd:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build Container Image
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}

-
name: SSH Remote Commands
uses: appleboy/ssh-action@v1.0.3
with:
host: server.geunsam2.xyz
username: cicduser
password: ${{ secrets.SSH_PASSWORD }}
port: 22
timeout: 40s
script: |
docker pull ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
docker rm -f ${{ env.CONTAINER_NAME }}
docker run -d -p ${{ env.PORT }}:3000 --name ${{ env.CONTAINER_NAME }} ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
12 changes: 12 additions & 0 deletions pages/members/03_hajung.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 큰제목
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다. deploy-single-server.yml은 머지 파일에 없어야 하는 걸로 알고 있어요.

안녕하세요
## 작은 제목
안녕하세요
# 큰제목
안녕하세요
## 작은 제목
안녕하세요
# 큰제목
안녕하세요
## 작은 제목
안녕하세요