Skip to content

Commit

Permalink
Merge pull request #353 from aura-nw/feat/create-hasura-metadata-merg…
Browse files Browse the repository at this point in the history
…e-develop

Feat/create hasura metadata merge develop
  • Loading branch information
fibonacci998 authored Sep 6, 2023
2 parents f456580 + ab913dd commit a66b00d
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 5 deletions.
36 changes: 35 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,41 @@ jobs:
NPM_TOKEN: ${{ secrets.KEY_NPM_RC }}
run: |
./ci/build.sh
build-hasura-metadata:
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set environment variable
run: |
SHORT_SHA_COMMIT=$(git rev-parse --short HEAD)
echo CONTAINER_RELEASE_IMAGE=ghcr.io/aura-nw/horoscope-hasura:${GITHUB_REF_NAME}_${SHORT_SHA_COMMIT} >> $GITHUB_ENV
- name: Check hasura changes
id: NUMBER_CHANGES
run: |
STATUS=`git diff HEAD^ HEAD hasura`
NUMBER_CHANGES=${#STATUS}
echo $NUMBER_CHANGES
echo NUMBER_CHANGES=$NUMBER_CHANGES >> $GITHUB_OUTPUT
- name: Build and push
if: ${{steps.NUMBER_CHANGES.outputs.NUMBER_CHANGES != 0}}
uses: docker/build-push-action@v4
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
tags: |
${{ env.CONTAINER_RELEASE_IMAGE }}
updateManifest:
runs-on: [ubuntu-latest]
needs: [lint, test, build]
Expand Down
5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
FROM node:16

## Install hasura cli
RUN curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | bash
FROM node:16-alpine

# Working directory
WORKDIR /app
Expand Down
16 changes: 16 additions & 0 deletions Dockerfile.hasura
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:16

## Install hasura cli
RUN curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | bash

# Working directory
WORKDIR /app

# Copy source
COPY . .

# cd to hasura directory
RUN cd hasura

# Apply metadata
CMD ["hasura", "metadata", "apply"]
7 changes: 7 additions & 0 deletions hasura/metadata/actions.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
actions: []
custom_types:
<<<<<<< HEAD
enums: []
input_objects: []
objects: []
scalars: []
=======
enums: []
input_objects: []
objects: []
scalars: []
>>>>>>> c1752e1 (feat: create empty hasura directory)
4 changes: 4 additions & 0 deletions hasura/metadata/allow_list.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<<<<<<< HEAD
- collection: allowed-queries
scope:
global: true
=======
[]
>>>>>>> c1752e1 (feat: create empty hasura directory)
4 changes: 4 additions & 0 deletions hasura/metadata/databases/databases.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<<<<<<< HEAD
- name: default
kind: postgres
configuration:
Expand Down Expand Up @@ -73,3 +74,6 @@
type_names:
prefix: xstaxy_
tables: "!include xstaxy/tables/tables.yaml"
=======
[]
>>>>>>> c1752e1 (feat: create empty hasura directory)
4 changes: 4 additions & 0 deletions hasura/metadata/query_collections.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<<<<<<< HEAD
- name: allowed-queries
definition:
queries: []
=======
[]
>>>>>>> c1752e1 (feat: create empty hasura directory)

0 comments on commit a66b00d

Please sign in to comment.