From 349328db83652ce57e1a8283db82bb012cc06afd Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Tue, 5 Sep 2023 16:26:36 +0700 Subject: [PATCH 01/25] feat: create dockerfile for hasura-cli --- Dockerfile | 5 +---- Dockerfile.hasura | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 Dockerfile.hasura diff --git a/Dockerfile b/Dockerfile index cdb449ebb..5fc8d550c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/Dockerfile.hasura b/Dockerfile.hasura new file mode 100644 index 000000000..4b0303785 --- /dev/null +++ b/Dockerfile.hasura @@ -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"] \ No newline at end of file From 07885c7f5d6b8a4f7a04e6aec8c8527059916d84 Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 11:04:21 +0700 Subject: [PATCH 02/25] feat: create ci to build hasura --- .github/workflows/ci.yml | 21 +++++++++++++++++++-- hasura/migrations/a | 1 + 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 hasura/migrations/a diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 45ceaea3b..8834fb5fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: CI on: workflow_dispatch: push: - branches: [develop, staging] + branches: [develop, staging, feat/create-hasura-metadata] jobs: lint: uses: ./.github/workflows/lint.yml @@ -26,7 +26,24 @@ jobs: NPM_TOKEN: ${{ secrets.KEY_NPM_RC }} run: | ./ci/build.sh - + check-hasura-metadata: + runs-on: [ubuntu-latest] + steps: + - uses: actions/checkout@v3 + - name: Check hasura changes + run: | + STATUS=`git status hasura -s` + NUMBER_CHANGES=${#STATUS} + echo "::set-output name=NUMBER_CHANGES::${#STATUS}" + outputs: + NUMBER_CHANGES: ${{ steps.set.outputs.NUMBER_CHANGES }} + build-hasura: + runs-on: [ubuntu-latest] + needs: + - check-hasura-metadata + if: needs.check-hasura-metadata.outputs.NUMBER_CHANGES == '0' + steps: + - run: echo "There is no changes in hasura" updateManifest: runs-on: [ubuntu-latest] needs: [lint, test, build] diff --git a/hasura/migrations/a b/hasura/migrations/a new file mode 100644 index 000000000..56a6051ca --- /dev/null +++ b/hasura/migrations/a @@ -0,0 +1 @@ +1 \ No newline at end of file From 3e2c011c5c3241adfcfdd979af8f6454621a2cd4 Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 13:08:16 +0700 Subject: [PATCH 03/25] feat: update ci for hasura --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8834fb5fc..1f969ac8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,9 +32,10 @@ jobs: - uses: actions/checkout@v3 - name: Check hasura changes run: | - STATUS=`git status hasura -s` + CURRENT_COMMIT=$(git rev-parse HEAD) + STATUS=`git diff ${CURRENT_COMMIT}^ ${CURRENT_COMMIT} hasura` NUMBER_CHANGES=${#STATUS} - echo "::set-output name=NUMBER_CHANGES::${#STATUS}" + echo NUMBER_CHANGES=${#STATUS} >> $GITHUB_ENV outputs: NUMBER_CHANGES: ${{ steps.set.outputs.NUMBER_CHANGES }} build-hasura: From e1631f1efe3297f573b2f1848bbcb3e3bf9d0980 Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 13:43:15 +0700 Subject: [PATCH 04/25] fix: update ci for hasura build --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f969ac8a..5d4b53961 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: - name: Check hasura changes run: | CURRENT_COMMIT=$(git rev-parse HEAD) - STATUS=`git diff ${CURRENT_COMMIT}^ ${CURRENT_COMMIT} hasura` + STATUS=`git diff HEAD^ HEAD hasura` NUMBER_CHANGES=${#STATUS} echo NUMBER_CHANGES=${#STATUS} >> $GITHUB_ENV outputs: From ef8e8ae696635db29f5b33f9ff978a6ab3b9ecb6 Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 13:46:25 +0700 Subject: [PATCH 05/25] fix: update ci for hasura build --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d4b53961..dca24c160 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,6 +32,7 @@ jobs: - uses: actions/checkout@v3 - name: Check hasura changes run: | + git status CURRENT_COMMIT=$(git rev-parse HEAD) STATUS=`git diff HEAD^ HEAD hasura` NUMBER_CHANGES=${#STATUS} From 254691a6635591e1aabaeb6186f502cf947d0ff0 Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 13:48:42 +0700 Subject: [PATCH 06/25] fix: update ci for hasura build --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dca24c160..538c99c9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: check-hasura-metadata: runs-on: [ubuntu-latest] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Check hasura changes run: | git status From 2e0574bed070838bad647f56dd2978cb13111753 Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 13:50:44 +0700 Subject: [PATCH 07/25] fix: update ci for hasura build --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 538c99c9a..393ec45fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,10 +29,11 @@ jobs: check-hasura-metadata: runs-on: [ubuntu-latest] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 + with: + fetch-depth: 2 - name: Check hasura changes run: | - git status CURRENT_COMMIT=$(git rev-parse HEAD) STATUS=`git diff HEAD^ HEAD hasura` NUMBER_CHANGES=${#STATUS} From f8818b61617b6481c0a3539218e3770b2714b3d8 Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 13:52:11 +0700 Subject: [PATCH 08/25] fix: update ci for hasura build --- .github/workflows/ci.yml | 4 ++-- hasura/migrations/a | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 393ec45fe..938032216 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,9 +44,9 @@ jobs: runs-on: [ubuntu-latest] needs: - check-hasura-metadata - if: needs.check-hasura-metadata.outputs.NUMBER_CHANGES == '0' + if: needs.check-hasura-metadata.outputs.NUMBER_CHANGES != '0' steps: - - run: echo "There is no changes in hasura" + - run: echo "There is changes in hasura" updateManifest: runs-on: [ubuntu-latest] needs: [lint, test, build] diff --git a/hasura/migrations/a b/hasura/migrations/a index 56a6051ca..d800886d9 100644 --- a/hasura/migrations/a +++ b/hasura/migrations/a @@ -1 +1 @@ -1 \ No newline at end of file +123 \ No newline at end of file From f1667b1a7e720f07096bff7aa4b04c923d04e1ff Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 13:54:50 +0700 Subject: [PATCH 09/25] fix: update ci for hasura build --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 938032216..da2239de4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,6 @@ jobs: fetch-depth: 2 - name: Check hasura changes run: | - CURRENT_COMMIT=$(git rev-parse HEAD) STATUS=`git diff HEAD^ HEAD hasura` NUMBER_CHANGES=${#STATUS} echo NUMBER_CHANGES=${#STATUS} >> $GITHUB_ENV @@ -44,7 +43,7 @@ jobs: runs-on: [ubuntu-latest] needs: - check-hasura-metadata - if: needs.check-hasura-metadata.outputs.NUMBER_CHANGES != '0' + if: needs.check-hasura-metadata.outputs.NUMBER_CHANGES steps: - run: echo "There is changes in hasura" updateManifest: From 4d7c1f7e250893d51ca92f76c54a62fdd3f750fe Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 13:56:07 +0700 Subject: [PATCH 10/25] fix: update ci for hasura build --- hasura/migrations/a | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hasura/migrations/a b/hasura/migrations/a index d800886d9..56a6051ca 100644 --- a/hasura/migrations/a +++ b/hasura/migrations/a @@ -1 +1 @@ -123 \ No newline at end of file +1 \ No newline at end of file From dd3523cf7603ebba2b0d9d9609c9c24f0a657c38 Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 14:04:16 +0700 Subject: [PATCH 11/25] fix: update ci for hasura build --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da2239de4..918d93866 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: runs-on: [ubuntu-latest] needs: - check-hasura-metadata - if: needs.check-hasura-metadata.outputs.NUMBER_CHANGES + if: needs.check-hasura-metadata.outputs.NUMBER_CHANGES != 0 steps: - run: echo "There is changes in hasura" updateManifest: From e11519ac7d69ac92f2a62561be22419f3dee0a89 Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 14:06:54 +0700 Subject: [PATCH 12/25] fix: update ci for hasura build --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 918d93866..b7a0b8c9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: run: | STATUS=`git diff HEAD^ HEAD hasura` NUMBER_CHANGES=${#STATUS} - echo NUMBER_CHANGES=${#STATUS} >> $GITHUB_ENV + echo NUMBER_CHANGES=${#STATUS} >> $GITHUB_OUTPUT outputs: NUMBER_CHANGES: ${{ steps.set.outputs.NUMBER_CHANGES }} build-hasura: From a739f7ac7d58de9a4443b223ba031e4899ae9aad Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 14:10:03 +0700 Subject: [PATCH 13/25] fix: update ci for hasura build --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7a0b8c9a..116afdae9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,9 +36,8 @@ jobs: run: | STATUS=`git diff HEAD^ HEAD hasura` NUMBER_CHANGES=${#STATUS} - echo NUMBER_CHANGES=${#STATUS} >> $GITHUB_OUTPUT - outputs: - NUMBER_CHANGES: ${{ steps.set.outputs.NUMBER_CHANGES }} + echo $NUMBER_CHANGES + echo NUMBER_CHANGES=$NUMBER_CHANGES >> $GITHUB_OUTPUT build-hasura: runs-on: [ubuntu-latest] needs: From 9f1c451077ae33a33826bdeddd51b416e45307a3 Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 14:14:40 +0700 Subject: [PATCH 14/25] fix: update ci for hasura build --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 116afdae9..9168ffe0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,11 +33,14 @@ jobs: with: fetch-depth: 2 - 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 + outputs: + NUMBER_CHANGES: ${{ steps.NUMBER_CHANGES.outputs.NUMBER_CHANGES}} build-hasura: runs-on: [ubuntu-latest] needs: From 775d4e57dbdf2d6a3ae274d1526cee1a99367890 Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 14:17:00 +0700 Subject: [PATCH 15/25] fix: update ci for hasura build --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9168ffe0c..d774192c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,9 +45,11 @@ jobs: runs-on: [ubuntu-latest] needs: - check-hasura-metadata - if: needs.check-hasura-metadata.outputs.NUMBER_CHANGES != 0 + # if: needs.check-hasura-metadata.outputs.NUMBER_CHANGES != 0 steps: - - run: echo "There is changes in hasura" + - run: | + echo ${{needs.check-hasura-metadata.outputs.NUMBER_CHANGES}} + echo "There is changes in hasura" updateManifest: runs-on: [ubuntu-latest] needs: [lint, test, build] From ed03fcf8a2fd49a12b5f7676a2d488b05e56674c Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 14:20:30 +0700 Subject: [PATCH 16/25] fix: update ci for hasura build --- .github/workflows/ci.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d774192c6..608fbb917 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,17 +39,21 @@ jobs: NUMBER_CHANGES=${#STATUS} echo $NUMBER_CHANGES echo NUMBER_CHANGES=$NUMBER_CHANGES >> $GITHUB_OUTPUT + - name: Build hasura + run: | + echo ${{steps.NUMBER_CHANGES.outputs.NUMBER_CHANGES}} + echo 'There is changes in hasura' outputs: NUMBER_CHANGES: ${{ steps.NUMBER_CHANGES.outputs.NUMBER_CHANGES}} - build-hasura: - runs-on: [ubuntu-latest] - needs: - - check-hasura-metadata - # if: needs.check-hasura-metadata.outputs.NUMBER_CHANGES != 0 - steps: - - run: | - echo ${{needs.check-hasura-metadata.outputs.NUMBER_CHANGES}} - echo "There is changes in hasura" + # build-hasura: + # runs-on: [ubuntu-latest] + # needs: + # - check-hasura-metadata + # # if: needs.check-hasura-metadata.outputs.NUMBER_CHANGES != 0 + # steps: + # - run: | + # echo ${{needs.check-hasura-metadata.outputs.NUMBER_CHANGES}} + # echo "There is changes in hasura" updateManifest: runs-on: [ubuntu-latest] needs: [lint, test, build] From b5e60ae9fc143fff8bee87808c64f9b0c470b989 Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 14:23:19 +0700 Subject: [PATCH 17/25] fix: update ci for hasura build --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 608fbb917..0762b8c78 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,8 +43,9 @@ jobs: run: | echo ${{steps.NUMBER_CHANGES.outputs.NUMBER_CHANGES}} echo 'There is changes in hasura' - outputs: - NUMBER_CHANGES: ${{ steps.NUMBER_CHANGES.outputs.NUMBER_CHANGES}} + - name: Test echo number changes + if: ${{steps.NUMBER_CHANGES.outputs.NUMBER_CHANGES}} != 0 + run: echo 'There is no changes in hasura' # build-hasura: # runs-on: [ubuntu-latest] # needs: From 7edbf56eb9d30786b4547f17fb17ce6f281f7322 Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 14:24:42 +0700 Subject: [PATCH 18/25] fix: update ci for hasura build --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0762b8c78..bfa006720 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: echo ${{steps.NUMBER_CHANGES.outputs.NUMBER_CHANGES}} echo 'There is changes in hasura' - name: Test echo number changes - if: ${{steps.NUMBER_CHANGES.outputs.NUMBER_CHANGES}} != 0 + if: ${{steps.NUMBER_CHANGES.outputs.NUMBER_CHANGES}} == 0 run: echo 'There is no changes in hasura' # build-hasura: # runs-on: [ubuntu-latest] From 96d6a6ccd3bc971805b495e2a4032800ff6ae5cf Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 14:28:36 +0700 Subject: [PATCH 19/25] fix: update ci for hasura build --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bfa006720..513bd908e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: echo ${{steps.NUMBER_CHANGES.outputs.NUMBER_CHANGES}} echo 'There is changes in hasura' - name: Test echo number changes - if: ${{steps.NUMBER_CHANGES.outputs.NUMBER_CHANGES}} == 0 + if: ${{steps.NUMBER_CHANGES.outputs.NUMBER_CHANGES == 0}} run: echo 'There is no changes in hasura' # build-hasura: # runs-on: [ubuntu-latest] From 6bd7dd7ffd179d2773b12ba9b29a1b0403d2e4ed Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 14:30:10 +0700 Subject: [PATCH 20/25] fix: update ci for hasura build --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 513bd908e..674195ceb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: echo ${{steps.NUMBER_CHANGES.outputs.NUMBER_CHANGES}} echo 'There is changes in hasura' - name: Test echo number changes - if: ${{steps.NUMBER_CHANGES.outputs.NUMBER_CHANGES == 0}} + if: ${{steps.NUMBER_CHANGES.outputs.NUMBER_CHANGES == '0'}} run: echo 'There is no changes in hasura' # build-hasura: # runs-on: [ubuntu-latest] From b5886858b5efdcfc7c35feb052e6d9bc305a7ed5 Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 14:32:08 +0700 Subject: [PATCH 21/25] fix: update ci for hasura build --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 674195ceb..a45da21ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: echo ${{steps.NUMBER_CHANGES.outputs.NUMBER_CHANGES}} echo 'There is changes in hasura' - name: Test echo number changes - if: ${{steps.NUMBER_CHANGES.outputs.NUMBER_CHANGES == '0'}} + if: ${{steps.NUMBER_CHANGES.outputs.NUMBER_CHANGES != 0}} run: echo 'There is no changes in hasura' # build-hasura: # runs-on: [ubuntu-latest] From 6b0541786bfa3be39552a596f6109281ff2a46d8 Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 14:34:13 +0700 Subject: [PATCH 22/25] fix: update ci for hasura build --- hasura/migrations/a | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hasura/migrations/a b/hasura/migrations/a index 56a6051ca..3e932fe8f 100644 --- a/hasura/migrations/a +++ b/hasura/migrations/a @@ -1 +1 @@ -1 \ No newline at end of file +34 \ No newline at end of file From c8f7a9cfa9ec8e9209e45961780469bbf4997f1c Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 14:39:31 +0700 Subject: [PATCH 23/25] fix: update ci for hasura build --- .github/workflows/ci.yml | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a45da21ad..6629b7b4e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,12 +26,24 @@ jobs: NPM_TOKEN: ${{ secrets.KEY_NPM_RC }} run: | ./ci/build.sh - check-hasura-metadata: + 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: | @@ -39,22 +51,16 @@ jobs: NUMBER_CHANGES=${#STATUS} echo $NUMBER_CHANGES echo NUMBER_CHANGES=$NUMBER_CHANGES >> $GITHUB_OUTPUT - - name: Build hasura - run: | - echo ${{steps.NUMBER_CHANGES.outputs.NUMBER_CHANGES}} - echo 'There is changes in hasura' - - name: Test echo number changes + - name: Build and push if: ${{steps.NUMBER_CHANGES.outputs.NUMBER_CHANGES != 0}} - run: echo 'There is no changes in hasura' - # build-hasura: - # runs-on: [ubuntu-latest] - # needs: - # - check-hasura-metadata - # # if: needs.check-hasura-metadata.outputs.NUMBER_CHANGES != 0 - # steps: - # - run: | - # echo ${{needs.check-hasura-metadata.outputs.NUMBER_CHANGES}} - # echo "There is changes in hasura" + 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] From c5da7dbc59599db5b7c01cde78e7bdae045eba42 Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 14:42:12 +0700 Subject: [PATCH 24/25] feat: create empty hasura directory --- hasura/metadata/actions.yaml | 7 +++++++ hasura/metadata/allow_list.yaml | 4 ++++ hasura/metadata/databases/databases.yaml | 4 ++++ hasura/metadata/query_collections.yaml | 4 ++++ hasura/migrations/a | 1 - 5 files changed, 19 insertions(+), 1 deletion(-) delete mode 100644 hasura/migrations/a diff --git a/hasura/metadata/actions.yaml b/hasura/metadata/actions.yaml index 1edb4c2ff..528453b2c 100644 --- a/hasura/metadata/actions.yaml +++ b/hasura/metadata/actions.yaml @@ -1,6 +1,13 @@ actions: [] custom_types: +<<<<<<< HEAD enums: [] input_objects: [] objects: [] scalars: [] +======= + enums: [] + input_objects: [] + objects: [] + scalars: [] +>>>>>>> c1752e1 (feat: create empty hasura directory) diff --git a/hasura/metadata/allow_list.yaml b/hasura/metadata/allow_list.yaml index 935c07949..231e2b8e7 100644 --- a/hasura/metadata/allow_list.yaml +++ b/hasura/metadata/allow_list.yaml @@ -1,3 +1,7 @@ +<<<<<<< HEAD - collection: allowed-queries scope: global: true +======= +[] +>>>>>>> c1752e1 (feat: create empty hasura directory) diff --git a/hasura/metadata/databases/databases.yaml b/hasura/metadata/databases/databases.yaml index 25ba5ee5b..9ad9c7a46 100644 --- a/hasura/metadata/databases/databases.yaml +++ b/hasura/metadata/databases/databases.yaml @@ -1,3 +1,4 @@ +<<<<<<< HEAD - name: default kind: postgres configuration: @@ -73,3 +74,6 @@ type_names: prefix: xstaxy_ tables: "!include xstaxy/tables/tables.yaml" +======= +[] +>>>>>>> c1752e1 (feat: create empty hasura directory) diff --git a/hasura/metadata/query_collections.yaml b/hasura/metadata/query_collections.yaml index 499c2aaab..545fbf16f 100644 --- a/hasura/metadata/query_collections.yaml +++ b/hasura/metadata/query_collections.yaml @@ -1,3 +1,7 @@ +<<<<<<< HEAD - name: allowed-queries definition: queries: [] +======= +[] +>>>>>>> c1752e1 (feat: create empty hasura directory) diff --git a/hasura/migrations/a b/hasura/migrations/a deleted file mode 100644 index 3e932fe8f..000000000 --- a/hasura/migrations/a +++ /dev/null @@ -1 +0,0 @@ -34 \ No newline at end of file From ab913ddb7cfb794cc562d4cbbddaa4ee1884b6df Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Wed, 6 Sep 2023 14:45:29 +0700 Subject: [PATCH 25/25] fix: remove test branch in ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6629b7b4e..aee3d8344 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: CI on: workflow_dispatch: push: - branches: [develop, staging, feat/create-hasura-metadata] + branches: [develop, staging] jobs: lint: uses: ./.github/workflows/lint.yml