Haven't checked yet
This commit is contained in:
77
.gitea/workflows/build-subgraphs.yml
Normal file
77
.gitea/workflows/build-subgraphs.yml
Normal file
@@ -0,0 +1,77 @@
|
||||
name: Build Subgraphs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'FictionArchive.Service.*/**'
|
||||
- 'FictionArchive.Common/**'
|
||||
- 'FictionArchive.Service.Shared/**'
|
||||
|
||||
jobs:
|
||||
build-subgraphs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
service:
|
||||
- name: novel-service
|
||||
project: FictionArchive.Service.NovelService
|
||||
subgraph: Novel
|
||||
- name: translation-service
|
||||
project: FictionArchive.Service.TranslationService
|
||||
subgraph: Translation
|
||||
- name: scheduler-service
|
||||
project: FictionArchive.Service.SchedulerService
|
||||
subgraph: Scheduler
|
||||
- name: user-service
|
||||
project: FictionArchive.Service.UserService
|
||||
subgraph: User
|
||||
- name: file-service
|
||||
project: FictionArchive.Service.FileService
|
||||
subgraph: File
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
|
||||
- name: Install Fusion CLI
|
||||
run: dotnet tool install -g HotChocolate.Fusion.CommandLine
|
||||
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore ${{ matrix.service.project }}/${{ matrix.service.project }}.csproj
|
||||
|
||||
- name: Build
|
||||
run: dotnet build ${{ matrix.service.project }}/${{ matrix.service.project }}.csproj -c Release --no-restore
|
||||
|
||||
- name: Export schema
|
||||
run: |
|
||||
dotnet run --project ${{ matrix.service.project }}/${{ matrix.service.project }}.csproj \
|
||||
--no-build -c Release --no-launch-profile \
|
||||
-- schema export --output ${{ matrix.service.project }}/schema.graphql
|
||||
|
||||
- name: Pack subgraph
|
||||
run: fusion subgraph pack -w ${{ matrix.service.project }}
|
||||
|
||||
- name: Upload subgraph package
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.service.name }}-subgraph
|
||||
path: ${{ matrix.service.project }}/*.fsp
|
||||
retention-days: 30
|
||||
|
||||
# Trigger gateway build after all subgraphs are built
|
||||
trigger-gateway:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build-subgraphs
|
||||
steps:
|
||||
- name: Trigger gateway workflow
|
||||
run: |
|
||||
curl -X POST \
|
||||
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||
"${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/actions/workflows/build-gateway.yml/dispatches" \
|
||||
-d '{"ref":"master"}'
|
||||
Reference in New Issue
Block a user