Skip to content

Commit

Permalink
use containers in GH actions (#580)
Browse files Browse the repository at this point in the history
* use containers in GH actions

* upd checkout action

* Fix retrieving the branch name
  • Loading branch information
ameshkov authored Sep 19, 2024
1 parent c697821 commit f792d7a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Build and deploy

env:
NODE_VERSION: 20
BASE_DOMAIN: kb-adg.pages.dev
BASE_PATH: /
PAGES_PROJECT: kb-adg
Expand All @@ -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
Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/crowdin.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Sync with Crowdin

env:
NODE_VERSION: 20

on:
push:
branches:
Expand All @@ -12,6 +9,8 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container:
image: node:20
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Lint Markdown

env:
NODE_VERSION: 20

on:
push:
branches:
Expand All @@ -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
Expand Down

0 comments on commit f792d7a

Please sign in to comment.