Deploy to GitHub Pages #81
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 to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Create site directory | |
| run: mkdir -p site | |
| - name: Copy static site files | |
| run: | | |
| # Copy all HTML, CSS, and image files from docs to site | |
| cp -r docs/* site/ | |
| - name: Copy API files | |
| run: | | |
| # Copy JSON-LD files to be served at their canonical URLs | |
| cp issuer.json site/issuer.json | |
| mkdir -p site/achievements | |
| cp achievements/*.json site/achievements/ | |
| - name: Copy DID document | |
| run: | | |
| # Copy .well-known directory for DID resolution | |
| mkdir -p site/.well-known | |
| cp .well-known/did.json site/.well-known/did.json | |
| - name: Add CNAME for custom domain | |
| run: echo "credentials.cognipilot.org" > site/CNAME | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: site | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |