31 lines
718 B
YAML
31 lines
718 B
YAML
name: Build and Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
run: |
|
|
git clone http://172.17.0.1:3000/kurihada/auth-backend.git .
|
|
git checkout ${{ github.sha }}
|
|
|
|
- name: Build Docker image
|
|
run: docker build -t auth-backend:latest .
|
|
|
|
- name: Deploy
|
|
run: |
|
|
docker stop auth-backend-container || true
|
|
docker rm auth-backend-container || true
|
|
docker run -d \
|
|
--name auth-backend-container \
|
|
--network nginx \
|
|
-p 9001:9001 \
|
|
--restart unless-stopped \
|
|
auth-backend:latest
|