Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,7 @@ jobs:

- run: ./test/check-docker-context.sh --min-size 5000 --max-size 10000 --min-count 600 --max-count 700

- name: Extract FRONTEND_VERSION
run: |
touch .env
echo "FRONTEND_VERSION=$(
docker compose config --format json | jq -r .services.nginx.build.args.FRONTEND_VERSION
)" >> "$GITHUB_ENV"

- run: ./files/ci/extract-frontend-version.sh
- run: FRONTEND_BUILD_MODE=fetch ./test/test-images.sh

# Check out the current frontend version referenced by docker-compose, as it should build OK.
Expand Down Expand Up @@ -162,12 +156,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4

- name: Extract FRONTEND_VERSION
run: |
touch .env
echo "FRONTEND_VERSION=$(
docker compose config --format json | jq -r .services.nginx.build.args.FRONTEND_VERSION
)" >> "$GITHUB_ENV"
- run: ./files/ci/extract-frontend-version.sh

- name: Build and push ${{ matrix.image }} Docker image
uses: docker/build-push-action@v7
Expand Down
21 changes: 21 additions & 0 deletions files/ci/extract-frontend-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash -eu
set -o pipefail
shopt -s inherit_errexit

log() { echo >&2 "[$(basename "$0")] $*"; }

log "Ensuring .env exists for docker compose..."
touch .env

log "Reading FRONTEND_VERSION from docker-compose.yml..."
if ! frontendVersion="$(docker compose config --format json | jq -er .services.nginx.build.args.FRONTEND_VERSION)"; then
log "!!!"
log "!!! Failed to read FRONTEND_VERSION from docker-compose.yml (got: '$frontendVersion')."
log "!!!"
exit 1
fi

log "Writing FRONTEND_VERSION to GITHUB_ENV file ($GITHUB_ENV)..."
echo "FRONTEND_VERSION=$frontendVersion" >> "$GITHUB_ENV"

log "Completed OK."
Loading