Merge pull request #26 from VectorInstitute/update_fedrag #30
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 Next.js Catalog to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'catalog/**' | |
| - 'repositories/**' | |
| - 'scripts/sync_repositories_to_json.py' | |
| - '.github/workflows/deploy-catalog.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: catalog/package-lock.json | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.9.11" | |
| enable-cache: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.12' | |
| - name: Install Python dependencies | |
| run: uv pip install --system pyyaml | |
| - name: Sync YAML repositories to JSON | |
| run: python scripts/sync_repositories_to_json.py | |
| - name: Install Node dependencies | |
| working-directory: catalog | |
| run: npm ci | |
| - name: Build Next.js site | |
| working-directory: catalog | |
| run: npm run build:github | |
| env: | |
| NEXT_PUBLIC_BASE_PATH: "true" | |
| - name: Ensure .nojekyll exists | |
| run: touch catalog/out/.nojekyll | |
| - name: Deploy to gh-pages branch | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./catalog/out | |
| publish_branch: gh-pages | |
| force_orphan: true |