Add applications page and development deployment (#21) #32
This file contains hidden or 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 mdbase.dev | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out website | |
| uses: actions/checkout@v7 | |
| - name: Read pinned source identities | |
| id: sources | |
| run: | | |
| echo "spec_repository=$(jq -r '.specification.repository' site-sources.json)" >> "$GITHUB_OUTPUT" | |
| echo "spec_ref=$(jq -r '.specification.ref' site-sources.json)" >> "$GITHUB_OUTPUT" | |
| echo "connect_repository=$(jq -r '.connect.repository' site-sources.json)" >> "$GITHUB_OUTPUT" | |
| echo "connect_ref=$(jq -r '.connect.ref' site-sources.json)" >> "$GITHUB_OUTPUT" | |
| echo "contracts_repository=$(jq -r '.contracts.repository' site-sources.json)" >> "$GITHUB_OUTPUT" | |
| echo "contracts_ref=$(jq -r '.contracts.ref' site-sources.json)" >> "$GITHUB_OUTPUT" | |
| echo "rust_repository=$(jq -r '.implementations[] | select(.id == "rust") | .repository' site-sources.json)" >> "$GITHUB_OUTPUT" | |
| echo "rust_ref=$(jq -r '.implementations[] | select(.id == "rust") | .ref' site-sources.json)" >> "$GITHUB_OUTPUT" | |
| echo "typescript_repository=$(jq -r '.implementations[] | select(.id == "typescript") | .repository' site-sources.json)" >> "$GITHUB_OUTPUT" | |
| echo "typescript_ref=$(jq -r '.implementations[] | select(.id == "typescript") | .ref' site-sources.json)" >> "$GITHUB_OUTPUT" | |
| - name: Check out specification | |
| uses: actions/checkout@v7 | |
| with: | |
| repository: ${{ steps.sources.outputs.spec_repository }} | |
| ref: ${{ steps.sources.outputs.spec_ref }} | |
| path: .sources/mdbase-spec | |
| - name: Check out Connect | |
| uses: actions/checkout@v7 | |
| with: | |
| repository: ${{ steps.sources.outputs.connect_repository }} | |
| ref: ${{ steps.sources.outputs.connect_ref }} | |
| path: .sources/mdbase-connect | |
| - name: Check out contracts | |
| uses: actions/checkout@v7 | |
| with: | |
| repository: ${{ steps.sources.outputs.contracts_repository }} | |
| ref: ${{ steps.sources.outputs.contracts_ref }} | |
| path: .sources/mdbase-contracts | |
| - name: Check out Rust implementation | |
| uses: actions/checkout@v7 | |
| with: | |
| repository: ${{ steps.sources.outputs.rust_repository }} | |
| ref: ${{ steps.sources.outputs.rust_ref }} | |
| path: .sources/mdbase-rs | |
| - name: Check out TypeScript implementation | |
| uses: actions/checkout@v7 | |
| with: | |
| repository: ${{ steps.sources.outputs.typescript_repository }} | |
| ref: ${{ steps.sources.outputs.typescript_ref }} | |
| path: .sources/mdbase | |
| - uses: pnpm/action-setup@v6 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - name: Install website dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build contract catalog | |
| working-directory: .sources/mdbase-contracts | |
| run: npm ci && npm run build | |
| - name: Build specification artifact | |
| working-directory: .sources/mdbase-spec/site | |
| run: npm ci && npm run build | |
| - name: Synchronize schemas, contracts, and conformance claims | |
| run: pnpm sync:sources | |
| env: | |
| MDBASE_SPEC_DIR: .sources/mdbase-spec | |
| MDBASE_CONNECT_DIR: .sources/mdbase-connect | |
| MDBASE_CONTRACTS_DIR: .sources/mdbase-contracts | |
| MDBASE_RS_DIR: .sources/mdbase-rs | |
| MDBASE_TS_DIR: .sources/mdbase | |
| - name: Check and build website | |
| run: pnpm check && pnpm build | |
| - name: Import specification | |
| run: pnpm import:spec | |
| env: | |
| MDBASE_SPEC_DIR: .sources/mdbase-spec | |
| - name: Check local links | |
| run: pnpm check:links | |
| - uses: actions/configure-pages@v6 | |
| - uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: dist | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |