Merge pull request #14 from AlexandrePelletier/main #79
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: Build & Deploy Hugo Site | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: # Allow manual triggering | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Setup Hugo | |
| uses: peaceiris/actions-hugo@v3 | |
| with: | |
| hugo-version: 'latest' | |
| extended: true | |
| - name: Download Hugo Book theme | |
| run: | | |
| mkdir -p website/themes | |
| cd website/themes | |
| git clone https://github.com/alex-shpak/hugo-book.git | |
| cd ../.. | |
| - name: Generate xQTL Data Catalog | |
| run: | | |
| python scripts/toc.py \ | |
| content/xqtl-data/{gwas,omics,qtl,study_info,reference_data}/*.md \ | |
| -o content/xqtl-data/README.md \ | |
| -t "FunGen-xQTL Data Catalog" \ | |
| -b "https://github.com/StatFunGen/xqtl-resources/tree/main/" \ | |
| -c "Lead analysts: " \ | |
| --subfolder-readme | |
| - name: Generate and Build Hugo Site | |
| run: | | |
| python scripts/hugo_generator.py \ | |
| --base-url https://statfungen.github.io/xqtl-resources/ \ | |
| --no-readme \ | |
| --no-theme-download \ | |
| --build \ | |
| --minify | |
| - name: Upload artifact for GitHub Pages | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./website/public | |
| 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 |