Files
webSite/.gitea/workflows/build.yml
Atakan b9ef84fd7e
Some checks failed
Build & Deploy Vite App (Docker) / build-and-deploy (push) Failing after 2m19s
change website port
2025-11-28 16:20:42 +03:00

42 lines
1.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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 3005:80 \
website-app:latest