Ajouter .giteat/workflows/main.yml

This commit is contained in:
aslane 2024-01-19 10:52:34 +00:00
parent d3c9c19428
commit cea99f323b
1 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,26 @@
name: Deployment CI/CD
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Stop and remove existing container (if exists)
run: |
docker stop stat || true
docker rm stat || true
- name: Build Docker image
run: |
docker build -t stat .
- name: Deploy to production
run: |
docker run -d -p 8080:8080 --name stat stat