Merge pull request #2628 from planetarium/exp/yang-build-test #185
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy gh pages | |
on: | |
push: | |
branches: | |
- development | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- uses: actions/setup-dotnet@v4 | |
name: Set up .NET Core SDK | |
with: | |
dotnet-version: 6.0.x | |
- name: Cache node modules | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install dependencies | |
run: yarn global add graphql @graphql-inspector/cli | |
- name: Install .NET dependencies | |
run: dotnet restore | |
- name: Build GraphQL Node | |
run: dotnet build --no-restore NineChronicles.Headless.Executable | |
- name: Build GraphQL Schema | |
run: | | |
dotnet run --project NineChronicles.Headless.Executable -- \ | |
--graphql-server \ | |
--graphql-port 30000 \ | |
--graphql-host localhost \ | |
--store-path /tmp/store \ | |
--no-miner \ | |
--no-cors \ | |
--skip-preload \ | |
-H localhost \ | |
-V "0/CbfC996ad185c61a031f40CeeE80a055e6D83005/MEUCIQCtoZmiFgg5NXW7+5jYMae80lTlj7xO4tQfX9CnvomAtwIgWViM8s.4mYQ89wlGkohmynZ43olDzZLBk.bHShKCVrc=" \ | |
-G "https://9c-dx.s3.ap-northeast-2.amazonaws.com/empty-genesis-block-20230511" & | |
sleep 60s | |
graphql-inspector introspect http://localhost:30000/graphql --write schema.graphql | |
- name: Build GraphQL Document | |
run: | | |
yarn global add spectaql | |
spectaql --target-dir public/graphql ./spectaql-config.yaml | |
- name: Build CLI Document | |
run: | | |
mkdir -p public/cli | |
dotnet run --project NineChronicles.Headless.Executable -- \ | |
docs \ | |
public/cli | |
- name: Copy Landing Page to deploy | |
run: cp Docs/resources/landing.html public/index.html | |
- name: Copy GraphQL Schema to deploy | |
run: cp schema.graphql public/schema.graphql | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public |