chore: configure releases and develop workflow
This commit is contained in:
+23
-18
@@ -2,8 +2,8 @@ name: Docs verify
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
branches: ['**']
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
verify:
|
||||
@@ -12,27 +12,32 @@ jobs:
|
||||
run:
|
||||
working-directory: workspace/docs
|
||||
steps:
|
||||
- name: Checkout workspace root
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
with:
|
||||
repository: WealthLedger/main
|
||||
ref: main
|
||||
path: workspace
|
||||
- uses: https://github.com/actions/checkout@v4
|
||||
with:
|
||||
path: workspace/docs
|
||||
- name: Checkout linked repositories
|
||||
run: |
|
||||
git clone --depth 1 --branch main https://git.personal.ksv741.ru/WealthLedger/frontend.git ../frontend
|
||||
git clone --depth 1 --branch main https://git.personal.ksv741.ru/WealthLedger/backend.git ../backend
|
||||
git clone --depth 1 --branch main https://git.personal.ksv741.ru/WealthLedger/specs.git ../specs
|
||||
- name: Record checked revisions
|
||||
- name: Checkout compatible peer revisions
|
||||
env:
|
||||
SOURCE_BRANCH: ${{ github.head_ref || github.ref_name }}
|
||||
TARGET_BRANCH: ${{ github.base_ref || github.ref_name }}
|
||||
run: |
|
||||
set -eu
|
||||
for repo in main frontend backend specs; do
|
||||
ref=develop
|
||||
case "$SOURCE_BRANCH:$TARGET_BRANCH" in
|
||||
release/*:*|*:main)
|
||||
ref=$(jq -er --arg repo "$repo" '.[$repo]' .ci/refs.json)
|
||||
printf '%s\n' "$ref" | grep -Eq '^[0-9a-f]{40}$'
|
||||
;;
|
||||
esac
|
||||
target="../$repo"
|
||||
if [ "$repo" = main ]; then target=..; fi
|
||||
git init "$target"
|
||||
git -C "$target" remote add origin "https://git.personal.ksv741.ru/WealthLedger/$repo.git"
|
||||
git -C "$target" fetch --depth 1 origin "$ref"
|
||||
git -C "$target" checkout --detach FETCH_HEAD
|
||||
git -C "$target" rev-parse HEAD
|
||||
done
|
||||
git rev-parse HEAD
|
||||
git -C .. rev-parse HEAD
|
||||
git -C ../frontend rev-parse HEAD
|
||||
git -C ../backend rev-parse HEAD
|
||||
git -C ../specs rev-parse HEAD
|
||||
- uses: https://github.com/actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: workspace/docs/.nvmrc
|
||||
|
||||
Reference in New Issue
Block a user