From 6044af04137fa2d6dbea9195b34f849df7b7afea Mon Sep 17 00:00:00 2001 From: Evgeniy Frolov Date: Tue, 17 Dec 2024 01:10:21 +0300 Subject: [PATCH] chore(ci): replace actions with steps (#283) Signed-off-by: Evgeniy Frolov --- .github/workflows/website_converge.yml | 13 +++++--- .github/workflows/website_review.yml | 33 -------------------- .github/workflows/website_review_dismiss.yml | 29 ----------------- .github/workflows/website_test.yml | 13 +++++--- docs/werf.yaml | 6 ++-- 5 files changed, 21 insertions(+), 73 deletions(-) delete mode 100644 .github/workflows/website_review.yml delete mode 100644 .github/workflows/website_review_dismiss.yml diff --git a/.github/workflows/website_converge.yml b/.github/workflows/website_converge.yml index cfef5cbf..81c26507 100644 --- a/.github/workflows/website_converge.yml +++ b/.github/workflows/website_converge.yml @@ -20,13 +20,18 @@ jobs: with: fetch-depth: 0 + - name: Install werf + uses: werf/actions/install@v2 + - name: Converge - uses: werf/actions/converge@v1.2 - with: - env: production - kube-config-base64-data: ${{ secrets.KUBECONFIG_BASE64_PROD }} + run: | + . $(werf ci-env github --as-file) + werf converge env: WERF_DIR: "docs" + WERF_ENV: "production" + WERF_KUBE_CONFIG_BASE64: ${{ secrets.KUBECONFIG_BASE64_PROD }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} notification: name: Notification diff --git a/.github/workflows/website_review.yml b/.github/workflows/website_review.yml deleted file mode 100644 index 44fcfaa0..00000000 --- a/.github/workflows/website_review.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Review website -on: - pull_request: - types: [labeled, synchronize] - workflow_dispatch: - -env: - WERF_REPO: "ghcr.io/${{ github.repository_owner }}/trdl" - -jobs: - converge: - name: Converge to Review - runs-on: ubuntu-latest-4-cores - if: github.event.label.name == 'review docs' || contains( github.event.pull_request.labels.*.name, 'review docs' ) - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Print review URL - env: - ENV_URL: "review-${{ github.event.number }}.trdl.dev.flant.com" - run: | - echo "https://${ENV_URL}" - - - name: Converge - uses: werf/actions/converge@v1.2 - with: - env: review-${{ github.event.number }} - kube-config-base64-data: ${{ secrets.KUBECONFIG_BASE64_DEV }} - env: - WERF_DIR: "docs" diff --git a/.github/workflows/website_review_dismiss.yml b/.github/workflows/website_review_dismiss.yml deleted file mode 100644 index 343862f8..00000000 --- a/.github/workflows/website_review_dismiss.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Review env Dismiss -on: - pull_request: - types: [closed, unlabeled] - workflow_dispatch: - -env: - WERF_REPO: "ghcr.io/${{ github.repository_owner }}/trdl" - -jobs: - dismiss: - name: Dismiss - runs-on: ubuntu-latest-4-cores - if: github.event.label.name == 'review docs' || contains( github.event.pull_request.labels.*.name, 'review docs' ) - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Dismiss - uses: werf/actions/dismiss@v1.2 - continue-on-error: true - with: - env: review-${{ github.event.number }} - kube-config-base64-data: ${{ secrets.KUBECONFIG_BASE64_DEV }} - env: - WERF_DIR: "docs" - WERF_WITH_NAMESPACE: true diff --git a/.github/workflows/website_test.yml b/.github/workflows/website_test.yml index 510eb9cc..61547202 100644 --- a/.github/workflows/website_test.yml +++ b/.github/workflows/website_test.yml @@ -18,10 +18,15 @@ jobs: with: fetch-depth: 0 + - name: Install werf + uses: werf/actions/install@v2 + - name: Converge - uses: werf/actions/converge@v1.2 - with: - env: test - kube-config-base64-data: ${{ secrets.KUBECONFIG_BASE64_DEV }} + run: | + . $(werf ci-env github --as-file) + werf converge env: WERF_DIR: "docs" + WERF_ENV: "test" + WERF_KUBE_CONFIG_BASE64: ${{ secrets.KUBECONFIG_BASE64_DEV }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/docs/werf.yaml b/docs/werf.yaml index 2d0ac8ca..8db62052 100644 --- a/docs/werf.yaml +++ b/docs/werf.yaml @@ -2,7 +2,7 @@ project: trdl-web configVersion: 1 --- -artifact: asset +image: asset from: jekyll/builder:3 fromCacheVersion: 20210426 shell: @@ -41,9 +41,9 @@ shell: {{ .Files.Get ".werf/nginx.conf" | indent 4 }} EOF import: -- artifact: asset +- image: asset add: /srv/jekyll-data/_site - to: /app/ + to: /app before: setup --- image: tuf-router