added runner
Some checks failed
Build & Deploy Vite App (Docker) / build-and-deploy (push) Has been cancelled

This commit is contained in:
Atakan
2025-11-28 16:19:47 +03:00
parent 329b3df928
commit 4542c44132

View File

@@ -0,0 +1,42 @@
name: Build & Deploy Vite App (Docker)
on:
push:
branches:
- main # kendi ana branch'ini yaz
jobs:
build-and-deploy:
runs-on: ubuntu-latest # runner'ın default label'ı, act_runner buna sahip olmalı
steps:
- name: Kodu checkout et
uses: actions/checkout@v3
# 1) Build'i Docker container içinde çalıştır
- name: Docker ile Vite build al
run: |
docker run --rm \
-v $PWD:/app \
-w /app \
node:24 \
/bin/bash -lc "npm install && npm run build"
# 2) Docker image oluştur
- name: Docker image build et
run: |
docker build -t website-app:latest .
# 3) Eski container'ı durdur / sil
- name: Eski container'ı durdur ve sil
run: |
docker stop website-app || true
docker rm website-app || true
# 4) Yeni image ile container'ı ayağa kaldır
- name: Yeni container'ı başlat
run: |
docker run -d \
--name website-app \
-p 8080:80 \
website-app:latest