Ajouter .giteat/workflows/main.yml
This commit is contained in:
parent
d3c9c19428
commit
cea99f323b
|
@ -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
|
Loading…
Reference in New Issue