diff --git a/.github/workflows/netlify-deploy-preview.yml b/.github/workflows/netlify-deploy-preview.yml new file mode 100644 index 0000000000..7cb0f010bb --- /dev/null +++ b/.github/workflows/netlify-deploy-preview.yml @@ -0,0 +1,100 @@ +name: trigger Netlify deploy preview + +on: + pull_request: + paths: ['sites/docs/**', 'sites/main-site/**'] + +jobs: + change-detection: + name: 'detect changed sub-sites' + runs-on: ubuntu-latest + steps: + - name: Checkout website repo + uses: actions/checkout@v4 + + - name: Check changed files + id: changed-files-yaml + uses: tj-actions/changed-files@v44 + with: + files_yaml: | + docs: + - sites/docs/** + main-site: + - sites/main-site/** + outputs: + main-site_any_changed: ${{ steps.changed-files-yaml.outputs.main-site_any_changed }} + docs_any_changed: ${{ steps.changed-files-yaml.outputs.docs_any_changed }} + + deploy-main-site: + name: 'Deploy preview for main-site' + runs-on: ubuntu-latest + needs: change-detection + if: github.repository == 'nf-core/website' && needs.change-detection.outputs.main-site_any_changed == 'true' + permissions: + pull-requests: write + steps: + - name: Checkout website repo + uses: actions/checkout@v4 + + - name: Set up Node.js 20 + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + + - name: Install npm deps + run: npm ci + + - name: Build website + run: npm run build --workspace sites/main-site + + - name: Deploy to Netlify + uses: nwtgck/actions-netlify@v3.0.0 + with: + publish-dir: './sites/main-site/dist' + github-token: ${{ secrets.GITHUB_TOKEN }} + deploy-message: 'nf-core/main-site PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}' + alias: nf-core-main-site-pr-${{ github.event.pull_request.number }} + enable-commit-comment: false + enable-commit-status: false + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_MAIN_SITE_ID }} + timeout-minutes: 1 + + deploy-docs: + name: 'Deploy preview for docs' + runs-on: ubuntu-latest + needs: change-detection + if: github.repository == 'nf-core/website' && needs.change-detection.outputs.docs_any_changed == 'true' + permissions: + pull-requests: write + steps: + - name: Checkout website repo + uses: actions/checkout@v4 + + - name: Set up Node.js 20 + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + + - name: Install npm deps + run: npm ci + + - name: Build website + run: npm run build --workspace sites/docs + + - name: Deploy to Netlify + uses: nwtgck/actions-netlify@v3.0.0 + with: + publish-dir: './sites/docs/dist' + github-token: ${{ secrets.GITHUB_TOKEN }} + deploy-message: 'nf-core/docs PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}' + alias: nf-core-docs-pr-${{ github.event.pull_request.number }} + enable-commit-comment: false + enable-commit-status: false + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DOCS_ID }} + timeout-minutes: 1 diff --git a/sites/main-site/src/pages/blog/index.astro b/sites/main-site/src/pages/blog/index.astro index 0473f7b64c..317fc0ad99 100644 --- a/sites/main-site/src/pages/blog/index.astro +++ b/sites/main-site/src/pages/blog/index.astro @@ -82,7 +82,7 @@ const sections: SidebarEntry[] = years.map((year) => { new Date(post.data.pubDate) && new Date(post.data.pubDate) > new Date(Date.now() - 2 * 24 * 60 * 60 * 1000) @@ -168,5 +168,6 @@ const sections: SidebarEntry[] = years.map((year) => { } .post-badge { z-index: 10; + width: fit-content; }