From f792d7ae9b24ca7fd5b6bff9b10dea409bac0d6f Mon Sep 17 00:00:00 2001 From: Andrey Meshkov Date: Fri, 20 Sep 2024 00:16:57 +0300 Subject: [PATCH] use containers in GH actions (#580) * use containers in GH actions * upd checkout action * Fix retrieving the branch name --- .github/workflows/build-deploy.yml | 13 +++++-------- .github/workflows/crowdin.yml | 5 ++--- .github/workflows/markdown-lint.yml | 11 +++-------- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index a5cfe10729d..43e4cb92d36 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -1,7 +1,6 @@ name: Build and deploy env: - NODE_VERSION: 20 BASE_DOMAIN: kb-adg.pages.dev BASE_PATH: / PAGES_PROJECT: kb-adg @@ -19,12 +18,10 @@ on: jobs: build: runs-on: ubuntu-latest + container: + image: node:20 steps: - - uses: actions/checkout@v3 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} + - uses: actions/checkout@v4 - name: Setup pnpm uses: pnpm/action-setup@v4 @@ -37,9 +34,9 @@ jobs: - name: Determine branch for deploy id: get-branch run: | - if [ "${{ github.ref_name }}" == "master" ]; then + if [ "${{ github.ref_name }}" = "master" ]; then echo "BRANCH_NAME=main" >> $GITHUB_ENV - elif [ "${{ github.event_name }}" == "pull_request" ]; then + elif [ "${{ github.event_name }}" = "pull_request" ]; then PR_NUMBER=${{ github.event.number }} echo "BRANCH_NAME=pull-request-${PR_NUMBER}" >> $GITHUB_ENV else diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index d19f2dede28..7c47468764f 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -1,8 +1,5 @@ name: Sync with Crowdin -env: - NODE_VERSION: 20 - on: push: branches: @@ -12,6 +9,8 @@ on: jobs: build: runs-on: ubuntu-latest + container: + image: node:20 steps: - uses: actions/checkout@v4 - name: Setup Node.js diff --git a/.github/workflows/markdown-lint.yml b/.github/workflows/markdown-lint.yml index 85b3db0cb36..2dd5b9d2cc0 100644 --- a/.github/workflows/markdown-lint.yml +++ b/.github/workflows/markdown-lint.yml @@ -1,8 +1,5 @@ name: Lint Markdown -env: - NODE_VERSION: 20 - on: push: branches: @@ -13,12 +10,10 @@ on: jobs: build: runs-on: ubuntu-latest + container: + image: node:20 steps: - - uses: actions/checkout@v3 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} + - uses: actions/checkout@v4 - name: Setup pnpm uses: pnpm/action-setup@v4