-
Notifications
You must be signed in to change notification settings - Fork 4
27 lines (22 loc) · 833 Bytes
/
dev.yaml
File metadata and controls
27 lines (22 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
name: Development Container - Build and Deploy Docker Image
on:
push:
branches:
- Dev
jobs:
build-and-deploy:
runs-on: self-hosted # 로컬 Ubuntu의 actions 계정에서 실행됨
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build and tag Docker image
run: |
docker build --no-cache -t ${{ secrets.DOCKER_HUB_USERNAME }}/control_dev:latest .
docker tag ${{ secrets.DOCKER_HUB_USERNAME }}/control_dev:latest ${{ secrets.DOCKER_HUB_USERNAME }}/control_dev:latest
- name: Deploy container locally
run: |
IMAGE=${{ secrets.DOCKER_HUB_USERNAME }}/control_dev:latest
docker stop CONTROL_DEV || true
docker rm CONTROL_DEV || true
docker run -d --name CONTROL_DEV -p 8082:8081 $IMAGE
docker system prune -af