근로자 채팅 리스트 디자인 수정 #42
This file contains hidden or 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: safe-bridge-frontend CI/CD | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/Hydrogen | |
- name: Cache node modules | |
uses: actions/cache@v4 | |
id: cache | |
with: | |
path: node_modules | |
key: npm-packages-${{ hashFiles('**/package-lock.json') }} | |
- name: Install Dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: npm install | |
- name: Build | |
run: CI=false npm run build | |
- name: Login to Docker Hub | |
run: echo "${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}" | docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build and push | |
run: | | |
docker buildx build --platform linux/amd64,linux/arm64 -t ${{ secrets.DOCKER_HUB_USERNAME }}/safe-bridge-frontend:latest --push . | |
- name: Pull and restart Docker Container | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.EC2_HOST }} | |
username: ${{ secrets.EC2_USER }} | |
key: ${{ secrets.EC2_SSH_KEY }} | |
script: | | |
cd ~/DOMAINS/safe-bridge | |
# 최신 이미지 pull | |
docker-compose pull | |
# 기존 컨테이너 중지 및 삭제 | |
docker-compose down | |
# 새로운 컨테이너 실행 | |
docker-compose up -d | |
# 실행 중인 컨테이너 확인 | |
docker ps |