From 5556d9ad7de1a57d5f32c97b0e20ed3657ae132f Mon Sep 17 00:00:00 2001 From: Artem Date: Mon, 8 Dec 2025 22:52:45 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20.gitea/workflows/flyway-migrate.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/flyway-migrate.yaml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/flyway-migrate.yaml b/.gitea/workflows/flyway-migrate.yaml index 5686f31..c57e89f 100644 --- a/.gitea/workflows/flyway-migrate.yaml +++ b/.gitea/workflows/flyway-migrate.yaml @@ -9,12 +9,22 @@ jobs: - name: Check out repository code uses: actions/checkout@v3 + # Необязательно, но полезно для отладки секретов + - name: Debug env + run: | + echo "DB_HOST=${{ secrets.DB_HOST }}" + echo "DB_PORT=${{ secrets.DB_PORT }}" + - name: Create test database uses: docker://alpine/psql:latest with: args: > sh -c 'export PGPASSWORD=${{ secrets.DB_PASSWORD }} && - psql -h ${{ secrets.DB_HOST }} -p ${{ secrets.DB_PORT }} -U ${{ secrets.DB_USER }} -d postgres + psql + -h ${{ secrets.DB_HOST }} + -p ${{ secrets.DB_PORT }} + -U ${{ secrets.DB_USER }} + -d postgres -c "DROP DATABASE IF EXISTS testdb;" -c "CREATE DATABASE testdb;"' @@ -34,7 +44,11 @@ jobs: with: args: > sh -c 'export PGPASSWORD=${{ secrets.DB_PASSWORD }} && - psql -h ${{ secrets.DB_HOST }} -p ${{ secrets.DB_PORT }} -U ${{ secrets.DB_USER }} -d testdb + psql + -h ${{ secrets.DB_HOST }} + -p ${{ secrets.DB_PORT }} + -U ${{ secrets.DB_USER }} + -d testdb -c "SELECT COUNT(*) FROM users;"' - name: Drop test database @@ -43,5 +57,9 @@ jobs: with: args: > sh -c 'export PGPASSWORD=${{ secrets.DB_PASSWORD }} && - psql -h ${{ secrets.DB_HOST }} -p ${{ secrets.DB_PORT }} -U ${{ secrets.DB_USER }} -d postgres + psql + -h ${{ secrets.DB_HOST }} + -p ${{ secrets.DB_PORT }} + -U ${{ secrets.DB_USER }} + -d postgres -c "DROP DATABASE IF EXISTS testdb;"'