254ebf28e7
Validate Flux manifests / kustomize-build (pull_request) Failing after 24s
Add checkout step for leeworks-agents/vin-decoder and copy vin-decoder/openapi.yaml into docs-site/public/specs/vin-decoder.yaml so the vin-decoder.astro Redoc page renders correctly. Closes leeworks-agents/api-company#148
94 lines
3.0 KiB
YAML
94 lines
3.0 KiB
YAML
# Gitea Actions: Aggregate openapi.yaml specs + trigger docs-site build
|
|
# Closes leeworks-agents/api-company#10
|
|
|
|
name: Build Docs Site
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
schedule:
|
|
# Re-build daily at 02:00 UTC to pick up spec changes
|
|
- cron: '0 2 * * *'
|
|
|
|
jobs:
|
|
aggregate-specs:
|
|
name: Aggregate OpenAPI Specs
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout api-company
|
|
uses: actions/checkout@v4
|
|
with:
|
|
path: api-company
|
|
|
|
- name: Checkout zip-enrichment
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: leeworks-agents/zip-enrichment
|
|
token: ${{ secrets.GITEA_TOKEN }}
|
|
path: zip-enrichment
|
|
|
|
- name: Checkout holidays
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: leeworks-agents/holidays
|
|
token: ${{ secrets.GITEA_TOKEN }}
|
|
path: holidays
|
|
|
|
- name: Checkout air-quality
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: leeworks-agents/air-quality
|
|
token: ${{ secrets.GITEA_TOKEN }}
|
|
path: air-quality
|
|
|
|
- name: Checkout vin-decoder
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: leeworks-agents/vin-decoder
|
|
token: ${{ secrets.GITEA_TOKEN }}
|
|
path: vin-decoder
|
|
|
|
- name: Copy openapi.yaml specs into docs-site
|
|
run: |
|
|
mkdir -p api-company/docs-site/public/specs
|
|
cp zip-enrichment/openapi.yaml api-company/docs-site/public/specs/zip-enrichment.yaml
|
|
cp holidays/openapi.yaml api-company/docs-site/public/specs/holidays.yaml
|
|
cp air-quality/openapi.yaml api-company/docs-site/public/specs/air-quality.yaml
|
|
cp vin-decoder/openapi.yaml api-company/docs-site/public/specs/vin-decoder.yaml
|
|
echo "Specs copied:"
|
|
ls -la api-company/docs-site/public/specs/
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Install docs-site dependencies
|
|
working-directory: api-company/docs-site
|
|
run: npm ci
|
|
|
|
- name: Build docs-site
|
|
working-directory: api-company/docs-site
|
|
run: npm run build
|
|
|
|
- name: Log in to container registry
|
|
run: |
|
|
echo "${{ secrets.GITEA_TOKEN }}" | docker login registry.leeworks.dev \
|
|
-u ${{ gitea.actor }} --password-stdin
|
|
|
|
- name: Build and push docs-site image
|
|
working-directory: api-company/docs-site
|
|
run: |
|
|
IMAGE="registry.leeworks.dev/leeworks-agents/docs-site"
|
|
SHA="${{ gitea.sha }}"
|
|
docker build -t "$IMAGE:$SHA" -t "$IMAGE:latest" .
|
|
docker push "$IMAGE:$SHA"
|
|
docker push "$IMAGE:latest"
|
|
echo "Pushed $IMAGE:$SHA"
|
|
|
|
- name: Trigger Flux reconcile (optional)
|
|
run: |
|
|
echo "Image pushed. Flux will detect new tag via image automation and re-deploy docs-site."
|
|
echo "If image automation is not configured, manually run: flux reconcile helmrelease docs-site -n docs-site"
|