[v1.10] Fixes for GH workflows for older OpenTofu versions (#3487)

Signed-off-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org>
This commit is contained in:
Andrei Ciobanu
2025-11-11 11:12:39 +02:00
committed by GitHub
parent 4b32aa801f
commit 7f6a6b9cc6
5 changed files with 37 additions and 8 deletions

View File

@@ -21,6 +21,17 @@ jobs:
- name: Prepare website container
run: docker compose -f docker-compose.build.yml build
working-directory: website
# The segregation between the next 2 steps is because on non-main branches, there are
# blog posts that point to the 'main' branch documentation that is fully missing from
# the branches that are used to maintain older versions of OpenTofu.
# Therefore, we run the full website check on main (and any branch in a PR that points
# to the main branch) and we run a trimmed down website checks for any runs against
# a non-main branch (or a PR that points to a non-main branch)
- name: Build website
if: github.ref == 'refs/heads/main' || github.base_ref == 'main'
run: docker compose -f docker-compose.build.yml up --exit-code-from website
working-directory: website
- name: Build website with warns
if: github.ref != 'refs/heads/main' && github.base_ref != 'main'
run: docker compose -f docker-compose.build-non-main.yml up --exit-code-from website
working-directory: website

Binary file not shown.

View File

@@ -0,0 +1,18 @@
# Copyright (c) The OpenTofu Authors
# SPDX-License-Identifier: MPL-2.0
# Copyright (c) 2023 HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
# This file is meant to be used only in running the `website` GH workflow on non-main branches and PRs that are targeting non-main branches.
# This is because the [blog/](https://github.com/opentofu/opentofu.org/tree/main/blog) content can point to documentation that is not available
# in branches of lower versions of OpenTofu.
services:
website:
build: .
ports:
- "3000:3000"
volumes:
- ../:/work/opentofu-repo/main
command: >
sh -c "sed -i 's#throw#warn#g' docusaurus.config.ts && npm run build"
restart: no

View File

@@ -1,8 +1,8 @@
# Copyright (c) The OpenTofu Authors
# SPDX-License-Identifier: MPL-2.0
# Copyright (c) 2023 HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
# Copyright (c) The OpenTofu Authors
# SPDX-License-Identifier: MPL-2.0
# Copyright (c) 2023 HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
# This docker-compose file tests the installation instructions with all operating systems. See #
# test-install-instructions.sh for details.
version: '3.2'
@@ -24,7 +24,7 @@ services:
command: /data/alpine.sh
working_dir: /data
debian-convenience:
image: debian:buster
image: debian:stable
volumes:
- source: ./
target: /data
@@ -32,7 +32,7 @@ services:
command: /data/deb.sh --convenience
working_dir: /data
debian-manual:
image: debian:buster
image: debian:stable
volumes:
- source: ./
target: /data

View File

@@ -35,7 +35,7 @@ for SERVICE in $SERVICES; do
echo -e "::group::\033[0;31m❌ ${SERVICE}\033[0m"
FAILED=$((${FAILED}+1))
fi
cat $TEMPFILE | grep -a -E "^[a-zA-Z]+-${SERVICE}-1\s+\| " | sed -E "s/^[a-zA-Z]+-${SERVICE}-1\s+\| //"
cat $TEMPFILE | grep -a -E "^${SERVICE}-1\s+\| " | sed -E "s/^${SERVICE}-1\s+\| //"
echo "::endgroup::"
done