diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..db808fa --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,24 @@ +name: Auto Deploy to Self-Hosted + +on: + push: + branches: + - prod + +jobs: + deploy: + runs-on: self-hosted + + steps: + - name: 🔄 Kodni olish + uses: actions/checkout@v4 + + - name: 📥 Secret orqali .env fayl yaratish + run: | + echo "${{ secrets.BASE_ENV_FILE }}" > .env + echo "${{ secrets.AUTH_ENV_FILE }}" > ./auth/.env + + - name: 🛠 Docker Compose bilan build & deploy + run: | + docker compose down + docker compose --profile auth --profile payment up -d --build \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index a771789..3c9c52a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,7 +15,7 @@ services: - "--entrypoints.web.address=:80" - "--providers.docker.exposedbydefault=false" ports: - - "80:80" + - "${PORT-84}:80" - "8080:8080" # Dashboard uchun volumes: - "/var/run/docker.sock:/var/run/docker.sock:ro"