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
24 changes: 21 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,15 @@ jobs:
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
# Build context is the repository root: the dashboard's dependencies are
# locked in the root package-lock.json. See packages/web-dashboard/Dockerfile.
- name: Build the dashboard image
run: docker build -t gitwire-dashboard:ci -f packages/web-dashboard/Dockerfile packages/web-dashboard
run: docker build -t gitwire-dashboard:ci -f packages/web-dashboard/Dockerfile .
# The Dockerfile installs from the lockfile with npm ci. This proves the
# image holds what the lockfile pins: every package version inside it
# has to be in package-lock.json, or the job fails.
- name: Compare the image's packages with the lockfile
run: node scripts/compare-image-deps.mjs --image gitwire-dashboard:ci
- name: Boot the dashboard and check it serves
run: |
docker run -d --name gitwire-dashboard-ci -p 3001:3001 \
Expand Down Expand Up @@ -522,7 +529,8 @@ jobs:
--build-arg GITWIRE_BUILT_AT="${{ steps.meta.outputs.built_at }}" \
--build-arg GITWIRE_VERSION="${{ steps.meta.outputs.version }}" \
-t "${{ steps.meta.outputs.dashboard_tag }}" \
packages/web-dashboard
-f packages/web-dashboard/Dockerfile \
.

- name: Verify OCI revision labels
run: |
Expand All @@ -536,6 +544,11 @@ jobs:
echo "✓ $img OCI revision: $ACTUAL"
done

# The dashboard release image is installed from the lockfile. Refuse to
# publish one that holds a package version the lockfile does not pin.
- name: Compare the dashboard release image's packages with the lockfile
run: node scripts/compare-image-deps.mjs --image "${{ steps.meta.outputs.dashboard_tag }}"

- name: Smoke-test app image (fail-closed)
env:
EXPECTED_SHA: ${{ steps.meta.outputs.release_sha }}
Expand Down Expand Up @@ -800,7 +813,12 @@ jobs:
--build-arg GITWIRE_BUILT_AT="${{ steps.meta.outputs.built_at }}" \
--build-arg GITWIRE_VERSION="${{ steps.meta.outputs.version }}" \
-t gitwire-dashboard:release-test \
packages/web-dashboard
-f packages/web-dashboard/Dockerfile \
.

# Same check as publish-release-images, against the local release-test tag.
- name: Compare the dashboard image's packages with the lockfile
run: node scripts/compare-image-deps.mjs --image gitwire-dashboard:release-test

- name: Verify OCI revision labels
run: |
Expand Down
6 changes: 4 additions & 2 deletions docker-compose.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ services:
dashboard:
image: gitwire-dashboard:dev
build:
context: packages/web-dashboard
dockerfile: Dockerfile
# The dashboard's dependencies are locked in the root package-lock.json,
# so its Dockerfile is built from the repository root.
context: .
dockerfile: packages/web-dashboard/Dockerfile
args:
GITWIRE_COMMIT_SHA: ${GITWIRE_COMMIT_SHA:-dev}
GITWIRE_BUILT_AT: ${GITWIRE_BUILT_AT:-unknown}
Expand Down
26 changes: 13 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading