Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement : Migrated data validation to Landscape2 Validation Action & Renamed data.yml to landscape.yml #49

Merged
merged 2 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
Expand All @@ -32,9 +29,12 @@ jobs:

# Build JSON Schema Landscape
- name: Build Landscape
env:
GITHUB_TOKENS: ${{ secrets.GITHUB_TOKEN }}
CRUNCHBASE_API_KEY: ${{ secrets.CRUNCHBASE_API_KEY }}
run: |
landscape2 build \
--data-file data.yml \
--data-file landscape.yml \
--settings-file settings.yml \
--guide-file guide.yml \
--logos-path logos \
Expand All @@ -46,4 +46,4 @@ jobs:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy build --project-name=${{ vars.CLOUDFLARE_PAGES_PROJECT_NAME }}
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
if: github.repository_owner == 'json-schema-org'
72 changes: 72 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Validate

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
validate-landscape-data:
runs-on: ubuntu-latest
name: "Validate landscape data file"
steps:
- uses: actions/checkout@v4
- uses: cncf/landscape2-validate-action@v2
with:
target_kind: data
target_path: ./landscape.yml

validate-landscape-settings:
runs-on: ubuntu-latest
name: "Validate landscape settings file"
steps:
- uses: actions/checkout@v4
- uses: cncf/landscape2-validate-action@v2
with:
target_kind: settings
target_path: ./settings.yml

validate-landscape-guide:
runs-on: ubuntu-latest
name: "Validate landscape guide file"
steps:
- uses: actions/checkout@v4
- uses: cncf/landscape2-validate-action@v2
with:
target_kind: guide
target_path: ./guide.yml

build-landscape:
runs-on: ubuntu-latest
name: Build landscape
needs: [validate-landscape-data, validate-landscape-settings, validate-landscape-guide]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20

# Install Landscape2
- name: Install Landscape2
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/cncf/landscape2/releases/download/v0.8.1/landscape2-installer.sh | sh

# Build Landscape
- name: Build Landscape
env:
GITHUB_TOKEN: ${{ secrets.AUTH_TOKEN }}
CRUNCHBASE_API_KEY: ${{ secrets.CRUNCHBASE_API_KEY }}
run: |
landscape2 build \
--data-file landscape.yml \
--settings-file settings.yml \
--guide-file guide.yml \
--logos-path logos \
--output-dir build
File renamed without changes.