diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..306877f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +* +.* + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..a6501e1 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,53 @@ +name: Build + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+*' + paths: + - 'Dockerfile' + - '.github/**' + +jobs: + build: + runs-on: ubuntu-24.04 + steps: + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Parse version from tag + id: parse + run: echo "$VERSION={GITHUB_REF_NAME:1}" >> "$GITHUB_OUTPUT" # removes the 'v' prefix + - name: Build and push + uses: docker/build-push-action@v6 + with: + tags: | + docker.io/fnndsc/hasura-cli:${{ steps.parse.outputs.VERSION }} + docker.io/fnndsc/hasura-cli:latest + ghcr.io/fnndsc/hasura-cli:${{ steps.parse.outputs.VERSION }} + ghcr.io/fnndsc/hasura-cli:latest + platforms: linux/amd64,linux/arm64 + build-args: VERSION=${{ github.ref_name }} + push: true + + dockerhub-description: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: Update DockerHub description + uses: peter-evans/dockerhub-description@v4 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + short-description: Hasura CLI + readme-filepath: ./README diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..118f751 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +# syntax=docker/dockerfile:1 +FROM docker.io/library/debian:bookworm-slim + +RUN apt-get update && apt-get -y --no-install-recommends install curl + +ARG VERSION=v2.40.0 +RUN curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | bash + +CMD ["hasura", "metadata", "apply"] diff --git a/README b/README new file mode 100644 index 0000000..b515812 --- /dev/null +++ b/README @@ -0,0 +1,4 @@ +Unofficial container image for hasura-cli. + +Upstream: https://hasura.io/docs/latest/hasura-cli/install-hasura-cli/ +Source: https://github.com/FNNDSC/hasura-cli