From 6334ad17f1608f16b116d4167ecdc8afcb56aae7 Mon Sep 17 00:00:00 2001 From: Vishnu Bharathi Date: Tue, 29 Oct 2024 12:21:23 +0530 Subject: [PATCH] ci: build and push ndc-hub:data. docker image (#361) This packages up the data in ndc-hub as a docker image. Sample build: https://github.com/hasura/ndc-hub/actions/runs/11504126541 Sample image: https://github.com/hasura/ndc-hub/pkgs/container/ndc-hub --- .github/workflows/ddn-assets.yaml | 44 +++++++++++++++++++++++++++++++ docker/data/Dockerfile | 3 +++ 2 files changed, 47 insertions(+) create mode 100644 .github/workflows/ddn-assets.yaml create mode 100644 docker/data/Dockerfile diff --git a/.github/workflows/ddn-assets.yaml b/.github/workflows/ddn-assets.yaml new file mode 100644 index 00000000..510377e4 --- /dev/null +++ b/.github/workflows/ddn-assets.yaml @@ -0,0 +1,44 @@ +name: DDN Assets + +on: + push: + branches: + - "main" + +jobs: + generate: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + attestations: write + id-token: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Generate data and push image + run: | + export NDC_HUB_GIT_REPO_FILE_PATH=$PWD + echo "NDC_HUB_GIT_REPO_FILE_PATH = $NDC_HUB_GIT_REPO_FILE_PATH" + + pushd docker/data + echo "Downloading ddn-assets" + wget https://github.com/hasura/ddn-assets/releases/download/v0.1.0/ddn-assets + chmod +x ddn-assets + + # TODO: get rid of this after fixing https://github.com/hasura/ddn-assets/issues/7 + mkdir assets + + echo "Running ddn-assets" + ./ddn-assets generate + + docker build -t ghcr.io/hasura/ndc-hub:data.$GITHUB_SHA . --push + popd diff --git a/docker/data/Dockerfile b/docker/data/Dockerfile new file mode 100644 index 00000000..c3d40d10 --- /dev/null +++ b/docker/data/Dockerfile @@ -0,0 +1,3 @@ +FROM scratch + +COPY assets /assets \ No newline at end of file