Skip to content

FIX : 임시 URL연결 #30

FIX : 임시 URL연결

FIX : 임시 URL연결 #30

Workflow file for this run

name: Client-dev-CD
on:
push:
branches: ["main"]
paths: client/**
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build Docker Image
run: docker build -f Dockerfile --build-arg NEXT_PUBLIC_BASE_URL=${{secrets.NEXT_PUBLIC_BASE_URL}} --build-arg NEXT_PUBLIC_CLIENT_BASE_URL=${{secrets.NEXT_PUBLIC_CLIENT_BASE_URL}} --build-arg PORT=${{secrets.CLIENT_DEV_PORT}} -t ${{ secrets.CLIENT_STORYBOOK_REPO }}/${{ secrets.CLIENT_DEV_SERVICE_NAME }}:latest .
working-directory: ./client
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.CLIENT_DOCKER_USERNAME }}
password: ${{ secrets.CLIENT_DOCKER_PASSWORD }}
- name: Push Image to Dockerhub
run: docker push ${{ secrets.CLIENT_STORYBOOK_REPO }}/${{ secrets.CLIENT_DEV_SERVICE_NAME }}:latest
- name: executing remote ssh commands using password
uses: appleboy/[email protected]
with:
host: ${{ secrets.STORYBOOK_CLOUD_HOST }}
username: root
password: ${{ secrets.STORYBOOK_CLOUD_PASSWORD }}
port: ${{ secrets.STORYBOOK_CLOUD_PORT }}
script: |
sudo docker pull ${{ secrets.CLIENT_STORYBOOK_REPO }}/${{ secrets.CLIENT_DEV_SERVICE_NAME }}:latest
sudo docker rm -f ${{ secrets.CLIENT_DEV_SERVICE_NAME }}
sudo docker run --name ${{ secrets.CLIENT_DEV_SERVICE_NAME }} -d -e PORT=${{secrets.CLIENT_DEV_PORT}} -p ${{ secrets.CLIENT_DEV_PORT }}:${{ secrets.CLIENT_DEV_PORT }} ${{ secrets.CLIENT_STORYBOOK_REPO }}/${{ secrets.CLIENT_DEV_SERVICE_NAME }}:latest
docker image prune -f