33 lines
1.1 KiB
YAML
33 lines
1.1 KiB
YAML
name: Build & Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
run: |
|
|
rm -rf site-vitrine
|
|
git clone --depth 1 --branch ${{ github.ref_name }} ${{ github.server_url }}/${{ github.repository }}.git site-vitrine
|
|
|
|
- name: Build Docker image
|
|
run: docker build -t site-vitrine:latest ./site-vitrine
|
|
|
|
- name: Deploy container
|
|
run: |
|
|
docker stop site-vitrine 2>/dev/null || true
|
|
docker rm site-vitrine 2>/dev/null || true
|
|
docker run -d \
|
|
--name site-vitrine \
|
|
--network proxy \
|
|
--restart unless-stopped \
|
|
-l "traefik.enable=true" \
|
|
-l "traefik.http.routers.site-vitrine.rule=Host(\"zola-labs.com\") || Host(\"www.zola-labs.com\")" \
|
|
-l "traefik.http.routers.site-vitrine.entrypoints=websecure" \
|
|
-l "traefik.http.routers.site-vitrine.tls.certresolver=letsencrypt" \
|
|
-l "traefik.http.services.site-vitrine.loadbalancer.server.port=80" \
|
|
site-vitrine:latest
|