mirror of
https://github.com/graphql-hive/console
synced 2026-04-21 14:37:17 +00:00
87 lines
2.5 KiB
YAML
87 lines
2.5 KiB
YAML
name: ci
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
# Release NPM packages and tarballs
|
|
package:
|
|
uses: ./.github/workflows/release-stable.yaml
|
|
secrets: inherit
|
|
|
|
# Build all packages and applications, and creates Docker images.
|
|
build:
|
|
needs:
|
|
- package
|
|
uses: ./.github/workflows/build-and-dockerize.yaml
|
|
with:
|
|
imageTag:
|
|
# prettier-ignore
|
|
${{ needs.package.outputs.hivePublish == 'true' && needs.package.outputs.hiveVersion || github.sha }}
|
|
publishSourceMaps: true
|
|
publishLatest: ${{ needs.package.outputs.hivePublish == 'true' }}
|
|
targets: build
|
|
uploadJavaScriptArtifacts: true
|
|
secrets: inherit
|
|
|
|
# Dockerize the CLI in case a CLI version was released
|
|
publish_docker_cli:
|
|
needs:
|
|
- package
|
|
uses: ./.github/workflows/dockerize-cli.yaml
|
|
if: ${{ needs.package.outputs.cliPublish == 'true' }}
|
|
with:
|
|
cliVersion: ${{ needs.package.outputs.cliVersion }}
|
|
publishLatest: true
|
|
secrets: inherit
|
|
|
|
# Trigger deployment for staging
|
|
deploy:
|
|
name: trigger staging deployment
|
|
needs:
|
|
- build
|
|
runs-on: ubuntu-22.04
|
|
if: ${{ vars.ENABLE_STAGING_DEPLOYMENT == '1' }}
|
|
steps:
|
|
- name: Dispatch Deployment
|
|
run: |
|
|
curl --request POST \
|
|
--url 'https://api.github.com/repos/${{ secrets.PRIVATE_REPO_OWNER }}/${{ secrets.PRIVATE_REPO_NAME }}/dispatches' \
|
|
--header 'Accept: application/vnd.github+json' \
|
|
--header 'Authorization: Bearer ${{ secrets.GH_PAT }}' \
|
|
--header 'X-GitHub-Api-Version: 2022-11-28' \
|
|
--header 'Content-Type: application/json' \
|
|
--data '{
|
|
"event_type": "deploy-staging",
|
|
"client_payload": {
|
|
"actor": "${{ github.actor }}",
|
|
"ref": "${{ github.sha }}",
|
|
"pulumiRefresh": "true",
|
|
"hiveAppUsePersistedDocuments": "true"
|
|
}
|
|
}'
|
|
|
|
# ESLint and Prettier
|
|
code-style:
|
|
uses: ./.github/workflows/lint.yaml
|
|
|
|
# TypeScript Typecheck and compiler checks
|
|
typescript:
|
|
uses: ./.github/workflows/typescript-typecheck.yaml
|
|
|
|
# Deploy Website to CloudFlare Pages
|
|
website:
|
|
uses: ./.github/workflows/website.yaml
|
|
secrets: inherit
|
|
|
|
# Deploy Storybook to CloudFlare Pages
|
|
storybook:
|
|
uses: ./.github/workflows/storybook.yaml
|
|
secrets: inherit
|
|
|
|
# GraphQL Schema Publish
|
|
graphql-schema:
|
|
uses: ./.github/workflows/graphql-schema-publish.yaml
|
|
secrets:
|
|
hiveToken: ${{ secrets.HIVE_TOKEN }}
|