Skip to content

Commit

Permalink
ci: build and push ndc-hub:data.<commit-sha> docker image (#361)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
scriptnull authored Oct 29, 2024
1 parent 3197b05 commit 6334ad1
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/ddn-assets.yaml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions docker/data/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM scratch

COPY assets /assets

0 comments on commit 6334ad1

Please sign in to comment.