diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f999c99..32c90c8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -103,18 +103,41 @@ jobs: mkdir output-client-base tar -C output-client-base -xf output-client-base.tar + - name: Build web-base + uses: docker/build-push-action@v5 + with: + context: web-base + outputs: type=oci,dest=output-web-base.tar + tags: ghcr.io/diracgrid/diracx-web/base:latest + platforms: linux/amd64,linux/arm64 + - name: Extract web-base + run: | + mkdir output-web-base + tar -C output-web-base -xf output-web-base.tar + - name: Push images if: ${{ github.event_name != 'pull_request' && github.repository == 'DIRACGrid/container-images' && github.ref_name == 'main' }} run: | set -x image_version=$(date +'%Y.%m.%d') + + # Push diracx base images # Check how many tags already exist for the current date and increment the version count=$(oras repo tags "ghcr.io/diracgrid/diracx/base" | { grep -c "${image_version}" || true; } ) image_version=${image_version}.${count} - echo "Pushing version ${image_version}" + echo "Pushing version ${image_version} for base images" for image_name in base services-base client-base; do image_repo=ghcr.io/diracgrid/diracx/${image_name} oras cp --from-oci-layout "$PWD/output-${image_name}:latest" "${image_repo}:latest,${image_version}" done + + # Push diracx-web image + count=$(oras repo tags "ghcr.io/diracgrid/diracx-web/base" | { grep -c "${image_version}" || true; } ) + image_version=${image_version}.${count} + echo "Pushing version ${image_version} for web-base image" + + image_repo=ghcr.io/diracgrid/diracx-web/base + oras cp --from-oci-layout "$PWD/output-web-base:latest" "${image_repo}:latest,${image_version}" + diff --git a/web-base/Dockerfile b/web-base/Dockerfile new file mode 100644 index 0000000..5e9e4e7 --- /dev/null +++ b/web-base/Dockerfile @@ -0,0 +1,5 @@ +FROM node:16-alpine + +# Install bash and git +RUN apk add --no-cache bash git +