Skip to content

Commit

Permalink
Update hive ci/cd (#45)
Browse files Browse the repository at this point in the history
Signed-off-by: jmasar <[email protected]>
Co-authored-by: jmasar <[email protected]>
  • Loading branch information
JumasJM and jmasar authored Feb 19, 2024
1 parent 32abfe2 commit 6403ac3
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 15 deletions.
32 changes: 24 additions & 8 deletions .github/workflows/hive-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- 'master'
- '[0-9]+.X-stable'
- '[0-9]+.[0-9]+.X-stable'

tags:
- 'v*'
Expand All @@ -18,16 +18,32 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v3
- name: schema publish
env:
HIVE_TOKEN: ${{ secrets.HIVE_TOKEN }}
HIVE_STABLE_LATEST_TOKEN: ${{ secrets.HIVE_STABLE_LATEST_TOKEN }}
# HIVE_ENDPOINT: ${{ secrets.HIVE_ENDPOINT }}
SCHEMA_PATH: "schellar/graph/schema.graphqls"

- name: Stable token
if: github.ref_type == 'branch' && endsWith(github.ref, '-stable')
run: |
echo "TOKEN=${{ secrets.HIVE_STABLE_LATEST_TOKEN }}" >> "$GITHUB_ENV"
- name: Master token
if: github.ref_type == 'branch' && startsWith(github.ref, 'refs/heads/master')
run: |
echo "TOKEN=${{ secrets.HIVE_TOKEN }}" >> "$GITHUB_ENV"
- name: Stable release token
if: github.ref_type == 'tag' && endsWith(github.ref, '-stable')
run: |
echo "TOKEN=${{ secrets.HIVE_STABLE_RELEASE_TOKEN }}" >> "$GITHUB_ENV"
- name: Master release token
if: ${{ github.ref_type == 'tag' && !endsWith(github.ref, '-stable') }}
run: |
echo "TOKEN=${ secrets.HIVE_MASTER_RELEASE_TOKEN }" >> "$GITHUB_ENV"
- name: Schema publish
env:
SCHEMA_PATH: "schellar/graph/schema.graphqls"
run: |
curl -sSL https://graphql-hive.com/install.sh | sh
hive schema:publish ${{ env.SCHEMA_PATH }} \
--registry.accessToken ${{ env.HIVE_STABLE_LATEST_TOKEN }} \
--registry.accessToken ${TOKEN} \
--github
31 changes: 24 additions & 7 deletions .github/workflows/hive-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
branches:
- 'master'
- '[0-9]+.X-stable'
- '[0-9]+.[0-9]+.X-stable'

tags:
- 'v*'
Expand All @@ -19,15 +19,32 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v3
- name: schema check
env:
HIVE_TOKEN: ${{ secrets.HIVE_TOKEN }}
HIVE_STABLE_LATEST_TOKEN: ${{ secrets.HIVE_STABLE_LATEST_TOKEN }}
SCHEMA_PATH: "schellar/graph/schema.graphqls"

- name: Stable token
if: github.ref_type == 'branch' && endsWith(github.ref, '-stable')
run: |
echo "TOKEN=${{ secrets.HIVE_STABLE_LATEST_TOKEN }}" >> "$GITHUB_ENV"
- name: Master token
if: github.ref_type == 'branch' && startsWith(github.ref, 'refs/heads/master')
run: |
echo "TOKEN=${{ secrets.HIVE_TOKEN }}" >> "$GITHUB_ENV"
- name: Stable release token
if: github.ref_type == 'tag' && endsWith(github.ref, '-stable')
run: |
echo "TOKEN=${{ secrets.HIVE_STABLE_RELEASE_TOKEN }}" >> "$GITHUB_ENV"
- name: Master release token
if: ${{ github.ref_type == 'tag' && !endsWith(github.ref, '-stable') }}
run: |
echo "TOKEN=${ secrets.HIVE_MASTER_RELEASE_TOKEN }" >> "$GITHUB_ENV"
- name: Schema check
env:
SCHEMA_PATH: "schellar/graph/schema.graphqls"
run: |
curl -sSL https://graphql-hive.com/install.sh | sh
hive schema:check ${{ env.SCHEMA_PATH }} \
--registry.accessToken ${{ env.HIVE_STABLE_LATEST_TOKEN }} \
--registry.accessToken ${TOKEN} \
--github

0 comments on commit 6403ac3

Please sign in to comment.