Skip to content

temp: 로고 이미지 변경 #52

temp: 로고 이미지 변경

temp: 로고 이미지 변경 #52

Workflow file for this run

name: Frontend CI/CD Pipeline
on:
push:
branches: [ dev ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Docker Login
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push Docker image
run: |
docker build -t ${{ secrets.DOCKER_HUB_USERNAME }}/ddokddokhana-frontend:latest .
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/ddokddokhana-frontend:latest
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- name: Build & Deploy
env:
PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
HOSTNAME: ${{secrets.SSH_HOST}}
USER_NAME: ${{secrets.USER_NAME}}
run: |
echo "$PRIVATE_KEY" > private_key && chmod 600 private_key
ssh -o StrictHostKeyChecking=no -i private_key ${USER_NAME}@${HOSTNAME} <<'EOF'
docker stop frontend
docker rm frontend
docker pull ${{ secrets.DOCKER_HUB_USERNAME }}/ddokddokhana-frontend:latest
docker run -d --name frontend -p 80:80 ${{ secrets.DOCKER_HUB_USERNAME }}/ddokddokhana-frontend:latest
EOF