From b76871536327823c7581b72b648ced032ddbd33e Mon Sep 17 00:00:00 2001 From: Pjandro Date: Thu, 22 Oct 2026 18:05:57 +0000 Subject: [PATCH] =?UTF-8?q?CI:=20=D1=80=D0=B0=D0=B7=D0=B1=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20job=20images=20=D0=BD=D0=B0=20images-app=20=D0=B8=20im?= =?UTF-8?q?ages-web=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BB?= =?UTF-8?q?=D0=BB=D0=B5=D0=BB=D1=8C=D0=BD=D0=BE=D0=B9=20=D1=81=D0=B1=D0=BE?= =?UTF-8?q?=D1=80=D0=BA=D0=B8=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B7=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/main.yml | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index 2019358..237d128 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -56,9 +56,9 @@ jobs: working-directory: wordpdf-web run: npm run lint - images: + images-app: runs-on: ubuntu-latest - needs: [java, web] + needs: java steps: - uses: actions/checkout@v5 @@ -95,6 +95,33 @@ jobs: docker push "$REGISTRY/wordpdf-app:prod" docker push "$REGISTRY/wordpdf-app:sha-$sha" + images-web: + runs-on: ubuntu-latest + needs: web + steps: + - uses: actions/checkout@v5 + + - name: Check registry vars and secret + env: + REGISTRY: ${{ vars.REGISTRY }} + REGISTRY_USER: ${{ secrets.REGISTRY_USER }} + REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} + run: | + [ -n "$REGISTRY" ] && [ -n "$REGISTRY_USER" ] && [ -n "$REGISTRY_PASSWORD" ] || { + echo "Задайте Actions Variable REGISTRY и Secrets REGISTRY_USER/REGISTRY_PASSWORD — см. GITEA-vars.md" >&2 + exit 1 + } + + - name: Docker auth + env: + REGISTRY: ${{ vars.REGISTRY }} + REGISTRY_USER: ${{ secrets.REGISTRY_USER }} + REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} + run: | + mkdir -p ~/.docker + printf '{"auths":{"%s":{"auth":"%s"}}}' "$REGISTRY" \ + "$(printf '%s:%s' "$REGISTRY_USER" "$REGISTRY_PASSWORD" | base64 -w0)" > ~/.docker/config.json + - name: Build and push web image env: REGISTRY: ${{ vars.REGISTRY }} @@ -110,7 +137,7 @@ jobs: deploy: runs-on: ubuntu-latest - needs: images + needs: [images-app, images-web] env: DEPLOY_HOST: ${{ vars.DEPLOY_HOST }} DEPLOY_USER: ${{ vars.DEPLOY_USER }}