From 0f32c497369c57865351067d55c6d57672d6006c Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 3 Jul 2024 10:39:32 +0200 Subject: [PATCH 01/21] first try for netlify deploy action --- .github/workflows/netlify-deploy-preview.yml | 82 ++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .github/workflows/netlify-deploy-preview.yml diff --git a/.github/workflows/netlify-deploy-preview.yml b/.github/workflows/netlify-deploy-preview.yml new file mode 100644 index 0000000000..00567048f6 --- /dev/null +++ b/.github/workflows/netlify-deploy-preview.yml @@ -0,0 +1,82 @@ +name: trigger Netlify deploy preview + +on: + pull_request: + paths: ['sites/docs/**', 'sites/main-site/**'] + +jobs: + pre-build: + name: 'prepare build setup' + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./website + steps: + - name: Checkout website repo + uses: actions/checkout@v4 + with: + path: ./website + + - 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: get changed sub-site + id: get_changed_subsite + run: | + CHANGED_DIRECTORY=$(git diff --name-only HEAD~1 HEAD | grep 'sites/' | cut -d/ -f2 | uniq) >> $GITHUB_ENV + + deploy-main-site: + name: 'Deploy preview for main-site' + runs-on: ubuntu-latest + needs: pre-build + if: github.repository == 'nf-core/website' && env.CHANGED_DIRECTORY == 'docs' + permissions: + pull-requests: write + steps: + - 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: pre-build + if: github.repository == 'nf-core/website' + permissions: + pull-requests: write + steps: + - 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 From 8487560c7e690721e50b2b11980fd53d647215bd Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 3 Jul 2024 10:41:37 +0200 Subject: [PATCH 02/21] fix new post badge --- sites/main-site/src/pages/blog/index.astro | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } From 34a7e9a7cb1084c370d0560f0129577d8825f71f Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 3 Jul 2024 10:43:55 +0200 Subject: [PATCH 03/21] try different syntax --- .github/workflows/netlify-deploy-preview.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/netlify-deploy-preview.yml b/.github/workflows/netlify-deploy-preview.yml index 00567048f6..8808318609 100644 --- a/.github/workflows/netlify-deploy-preview.yml +++ b/.github/workflows/netlify-deploy-preview.yml @@ -30,12 +30,14 @@ jobs: id: get_changed_subsite run: | CHANGED_DIRECTORY=$(git diff --name-only HEAD~1 HEAD | grep 'sites/' | cut -d/ -f2 | uniq) >> $GITHUB_ENV + outputs: + changed_directory: ${{ env.CHANGED_DIRECTORY }} deploy-main-site: name: 'Deploy preview for main-site' runs-on: ubuntu-latest needs: pre-build - if: github.repository == 'nf-core/website' && env.CHANGED_DIRECTORY == 'docs' + if: github.repository == 'nf-core/website' && needs.pre-build.outputs.changed_directory == 'main-site' permissions: pull-requests: write steps: @@ -60,7 +62,7 @@ jobs: name: 'Deploy preview for docs' runs-on: ubuntu-latest needs: pre-build - if: github.repository == 'nf-core/website' + if: github.repository == 'nf-core/website' && needs.pre-build.outputs.changed_directory == 'docs' permissions: pull-requests: write steps: From ee5fff64cc58633c63cb101c3db0de389e3f0431 Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 3 Jul 2024 10:46:23 +0200 Subject: [PATCH 04/21] debug action --- .github/workflows/netlify-deploy-preview.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/netlify-deploy-preview.yml b/.github/workflows/netlify-deploy-preview.yml index 8808318609..0c0b6de5fc 100644 --- a/.github/workflows/netlify-deploy-preview.yml +++ b/.github/workflows/netlify-deploy-preview.yml @@ -26,6 +26,12 @@ jobs: - name: Install npm deps run: npm ci + - name: debug + run: | + ls -l . + ls -l .. + pwd + - name: get changed sub-site id: get_changed_subsite run: | @@ -36,6 +42,9 @@ jobs: deploy-main-site: name: 'Deploy preview for main-site' runs-on: ubuntu-latest + defaults: + run: + working-directory: ./website needs: pre-build if: github.repository == 'nf-core/website' && needs.pre-build.outputs.changed_directory == 'main-site' permissions: @@ -61,6 +70,9 @@ jobs: deploy-docs: name: 'Deploy preview for docs' runs-on: ubuntu-latest + defaults: + run: + working-directory: ./website needs: pre-build if: github.repository == 'nf-core/website' && needs.pre-build.outputs.changed_directory == 'docs' permissions: From 4900d72c6639afa3cd2520148a33f7769042a044 Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 3 Jul 2024 10:48:09 +0200 Subject: [PATCH 05/21] more debugging --- .github/workflows/netlify-deploy-preview.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/netlify-deploy-preview.yml b/.github/workflows/netlify-deploy-preview.yml index 0c0b6de5fc..f4ee253ccc 100644 --- a/.github/workflows/netlify-deploy-preview.yml +++ b/.github/workflows/netlify-deploy-preview.yml @@ -16,7 +16,11 @@ jobs: uses: actions/checkout@v4 with: path: ./website - + - name: debug + run: | + ls -l . + ls -l .. + pwd - name: Set up Node.js 20 uses: actions/setup-node@v4 with: From e0d02ddcd53e87a7763062571dd7431a9b0f183f Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 3 Jul 2024 10:50:39 +0200 Subject: [PATCH 06/21] specify cache-path --- .github/workflows/netlify-deploy-preview.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/netlify-deploy-preview.yml b/.github/workflows/netlify-deploy-preview.yml index f4ee253ccc..aff9d58fcf 100644 --- a/.github/workflows/netlify-deploy-preview.yml +++ b/.github/workflows/netlify-deploy-preview.yml @@ -26,6 +26,7 @@ jobs: with: node-version: 20 cache: 'npm' + cache-dependency-path: ./website/package-lock.json - name: Install npm deps run: npm ci From 21d5b31105035ef0dcfd5e6b06796d0a82af5cb5 Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 3 Jul 2024 11:00:01 +0200 Subject: [PATCH 07/21] try new git diff strategy --- .github/workflows/netlify-deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/netlify-deploy-preview.yml b/.github/workflows/netlify-deploy-preview.yml index aff9d58fcf..0b785c3c53 100644 --- a/.github/workflows/netlify-deploy-preview.yml +++ b/.github/workflows/netlify-deploy-preview.yml @@ -40,7 +40,7 @@ jobs: - name: get changed sub-site id: get_changed_subsite run: | - CHANGED_DIRECTORY=$(git diff --name-only HEAD~1 HEAD | grep 'sites/' | cut -d/ -f2 | uniq) >> $GITHUB_ENV + CHANGED_DIRECTORY=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -E 'sites/(main-site|docs)' | head -n1 | cut -d'/' -f2) >> $GITHUB_ENV outputs: changed_directory: ${{ env.CHANGED_DIRECTORY }} From dd453d0fc898fc7a74fde0a7042b73454844e1ea Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 3 Jul 2024 11:03:36 +0200 Subject: [PATCH 08/21] try different variable --- .github/workflows/netlify-deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/netlify-deploy-preview.yml b/.github/workflows/netlify-deploy-preview.yml index 0b785c3c53..f6634fe89a 100644 --- a/.github/workflows/netlify-deploy-preview.yml +++ b/.github/workflows/netlify-deploy-preview.yml @@ -40,7 +40,7 @@ jobs: - name: get changed sub-site id: get_changed_subsite run: | - CHANGED_DIRECTORY=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -E 'sites/(main-site|docs)' | head -n1 | cut -d'/' -f2) >> $GITHUB_ENV + CHANGED_DIRECTORY=$(git diff --name-only ${{ github.event.before }} HEAD | grep -E 'sites/(main-site|docs)' | head -n1 | cut -d'/' -f2) >> $GITHUB_ENV outputs: changed_directory: ${{ env.CHANGED_DIRECTORY }} From 8393dbd15746926dd659f6c612e51622d7380d3c Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 3 Jul 2024 11:06:07 +0200 Subject: [PATCH 09/21] yet another variable --- .github/workflows/netlify-deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/netlify-deploy-preview.yml b/.github/workflows/netlify-deploy-preview.yml index f6634fe89a..72d00d3b69 100644 --- a/.github/workflows/netlify-deploy-preview.yml +++ b/.github/workflows/netlify-deploy-preview.yml @@ -40,7 +40,7 @@ jobs: - name: get changed sub-site id: get_changed_subsite run: | - CHANGED_DIRECTORY=$(git diff --name-only ${{ github.event.before }} HEAD | grep -E 'sites/(main-site|docs)' | head -n1 | cut -d'/' -f2) >> $GITHUB_ENV + CHANGED_DIRECTORY=$(git diff --name-only ${{ github.base_ref }}...${{ github.head_ref }} | grep -E 'sites/(main-site|docs)' | head -n1 | cut -d'/' -f2) outputs: changed_directory: ${{ env.CHANGED_DIRECTORY }} From 88361b7fb0d89fd14ce86f51fe1b47fdaaf912d0 Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 3 Jul 2024 11:15:06 +0200 Subject: [PATCH 10/21] try another comparison --- .github/workflows/netlify-deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/netlify-deploy-preview.yml b/.github/workflows/netlify-deploy-preview.yml index 72d00d3b69..ebeef0bbe9 100644 --- a/.github/workflows/netlify-deploy-preview.yml +++ b/.github/workflows/netlify-deploy-preview.yml @@ -40,7 +40,7 @@ jobs: - name: get changed sub-site id: get_changed_subsite run: | - CHANGED_DIRECTORY=$(git diff --name-only ${{ github.base_ref }}...${{ github.head_ref }} | grep -E 'sites/(main-site|docs)' | head -n1 | cut -d'/' -f2) + CHANGED_DIRECTORY=$(git diff --name-only ${{ github.base_ref }}...HEAD | grep -E 'sites/(main-site|docs)' | head -n1 | cut -d'/' -f2) outputs: changed_directory: ${{ env.CHANGED_DIRECTORY }} From e392b7573015a44ba3fecb42d9c6f99dc375b774 Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 3 Jul 2024 11:17:43 +0200 Subject: [PATCH 11/21] more git debugging --- .github/workflows/netlify-deploy-preview.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/netlify-deploy-preview.yml b/.github/workflows/netlify-deploy-preview.yml index ebeef0bbe9..7e628fdf8b 100644 --- a/.github/workflows/netlify-deploy-preview.yml +++ b/.github/workflows/netlify-deploy-preview.yml @@ -36,6 +36,7 @@ jobs: ls -l . ls -l .. pwd + git status - name: get changed sub-site id: get_changed_subsite From a066dbe6533946deac480364d10c66f52b63a24f Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 3 Jul 2024 11:20:42 +0200 Subject: [PATCH 12/21] yet another diff try --- .github/workflows/netlify-deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/netlify-deploy-preview.yml b/.github/workflows/netlify-deploy-preview.yml index 7e628fdf8b..bdccd8dd77 100644 --- a/.github/workflows/netlify-deploy-preview.yml +++ b/.github/workflows/netlify-deploy-preview.yml @@ -41,7 +41,7 @@ jobs: - name: get changed sub-site id: get_changed_subsite run: | - CHANGED_DIRECTORY=$(git diff --name-only ${{ github.base_ref }}...HEAD | grep -E 'sites/(main-site|docs)' | head -n1 | cut -d'/' -f2) + CHANGED_DIRECTORY=$(git diff --name-only ${{ github.base_ref }}.HEAD | grep -E 'sites/(main-site|docs)' | head -n1 | cut -d'/' -f2) outputs: changed_directory: ${{ env.CHANGED_DIRECTORY }} From a165d00e13a4953e63c29553371407cf5185d942 Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 3 Jul 2024 11:23:30 +0200 Subject: [PATCH 13/21] another try --- .github/workflows/netlify-deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/netlify-deploy-preview.yml b/.github/workflows/netlify-deploy-preview.yml index bdccd8dd77..d9aff5b36b 100644 --- a/.github/workflows/netlify-deploy-preview.yml +++ b/.github/workflows/netlify-deploy-preview.yml @@ -41,7 +41,7 @@ jobs: - name: get changed sub-site id: get_changed_subsite run: | - CHANGED_DIRECTORY=$(git diff --name-only ${{ github.base_ref }}.HEAD | grep -E 'sites/(main-site|docs)' | head -n1 | cut -d'/' -f2) + CHANGED_DIRECTORY=$(git diff --name-only ${{ github.base_ref }}...${{github.head_ref}} | grep -E 'sites/(main-site|docs)' | head -n 1 | cut -d'/' -f2) outputs: changed_directory: ${{ env.CHANGED_DIRECTORY }} From 0007fb08970054ea59d31a112ee73f86fc45ce7d Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 3 Jul 2024 11:29:04 +0200 Subject: [PATCH 14/21] switch diff strategy --- .github/workflows/netlify-deploy-preview.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/netlify-deploy-preview.yml b/.github/workflows/netlify-deploy-preview.yml index d9aff5b36b..ce56be63fe 100644 --- a/.github/workflows/netlify-deploy-preview.yml +++ b/.github/workflows/netlify-deploy-preview.yml @@ -38,12 +38,17 @@ jobs: pwd git status - - name: get changed sub-site - id: get_changed_subsite - run: | - CHANGED_DIRECTORY=$(git diff --name-only ${{ github.base_ref }}...${{github.head_ref}} | grep -E 'sites/(main-site|docs)' | head -n 1 | cut -d'/' -f2) + - 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: - changed_directory: ${{ env.CHANGED_DIRECTORY }} + changed_directory: ${{ env.changed_files_yaml }} deploy-main-site: name: 'Deploy preview for main-site' @@ -52,7 +57,7 @@ jobs: run: working-directory: ./website needs: pre-build - if: github.repository == 'nf-core/website' && needs.pre-build.outputs.changed_directory == 'main-site' + if: github.repository == 'nf-core/website' && needs.pre-build.outputs.changed_directory.main-site_any_changed == 'true' permissions: pull-requests: write steps: @@ -80,7 +85,7 @@ jobs: run: working-directory: ./website needs: pre-build - if: github.repository == 'nf-core/website' && needs.pre-build.outputs.changed_directory == 'docs' + if: github.repository == 'nf-core/website' && needs.pre-build.outputs.changed_directory.docs_any_changed == 'true' permissions: pull-requests: write steps: From 5dc2f80db913008e1355740ff98dba74855807d5 Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 3 Jul 2024 11:45:09 +0200 Subject: [PATCH 15/21] fix output --- .github/workflows/netlify-deploy-preview.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/netlify-deploy-preview.yml b/.github/workflows/netlify-deploy-preview.yml index ce56be63fe..5d959e49cf 100644 --- a/.github/workflows/netlify-deploy-preview.yml +++ b/.github/workflows/netlify-deploy-preview.yml @@ -48,8 +48,8 @@ jobs: main-site: - sites/main-site/** outputs: - changed_directory: ${{ env.changed_files_yaml }} - + 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 @@ -57,7 +57,7 @@ jobs: run: working-directory: ./website needs: pre-build - if: github.repository == 'nf-core/website' && needs.pre-build.outputs.changed_directory.main-site_any_changed == 'true' + if: github.repository == 'nf-core/website' && needs.pre-build.outputs.main-site_any_changed == 'true' permissions: pull-requests: write steps: @@ -85,7 +85,7 @@ jobs: run: working-directory: ./website needs: pre-build - if: github.repository == 'nf-core/website' && needs.pre-build.outputs.changed_directory.docs_any_changed == 'true' + if: github.repository == 'nf-core/website' && needs.pre-build.outputs.docs_any_changed == 'true' permissions: pull-requests: write steps: From 3c36f664ff4c7da07c94598eb16a9ae7afc573fa Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 3 Jul 2024 11:51:50 +0200 Subject: [PATCH 16/21] try to fix the directory path --- .github/workflows/netlify-deploy-preview.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/netlify-deploy-preview.yml b/.github/workflows/netlify-deploy-preview.yml index 5d959e49cf..dc854e1efb 100644 --- a/.github/workflows/netlify-deploy-preview.yml +++ b/.github/workflows/netlify-deploy-preview.yml @@ -53,9 +53,6 @@ jobs: deploy-main-site: name: 'Deploy preview for main-site' runs-on: ubuntu-latest - defaults: - run: - working-directory: ./website needs: pre-build if: github.repository == 'nf-core/website' && needs.pre-build.outputs.main-site_any_changed == 'true' permissions: @@ -81,9 +78,6 @@ jobs: deploy-docs: name: 'Deploy preview for docs' runs-on: ubuntu-latest - defaults: - run: - working-directory: ./website needs: pre-build if: github.repository == 'nf-core/website' && needs.pre-build.outputs.docs_any_changed == 'true' permissions: From a670940525bbf08486809a69afe3820fef6b6916 Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 3 Jul 2024 12:10:26 +0200 Subject: [PATCH 17/21] add debug step --- .github/workflows/netlify-deploy-preview.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/netlify-deploy-preview.yml b/.github/workflows/netlify-deploy-preview.yml index dc854e1efb..f27dd404d9 100644 --- a/.github/workflows/netlify-deploy-preview.yml +++ b/.github/workflows/netlify-deploy-preview.yml @@ -53,11 +53,20 @@ jobs: deploy-main-site: name: 'Deploy preview for main-site' runs-on: ubuntu-latest + defaults: + run: + working-directory: website needs: pre-build if: github.repository == 'nf-core/website' && needs.pre-build.outputs.main-site_any_changed == 'true' permissions: pull-requests: write steps: + - name: debug + run: | + ls -l . + ls -l .. + pwd + - name: Build website run: npm run build --workspace sites/main-site @@ -78,6 +87,9 @@ jobs: deploy-docs: name: 'Deploy preview for docs' runs-on: ubuntu-latest + defaults: + run: + working-directory: website needs: pre-build if: github.repository == 'nf-core/website' && needs.pre-build.outputs.docs_any_changed == 'true' permissions: From 08df55d2dbbf13acce860a4af173e54a1dc1131b Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 3 Jul 2024 12:20:37 +0200 Subject: [PATCH 18/21] restructure jobs --- .github/workflows/netlify-deploy-preview.yml | 68 +++++++++----------- 1 file changed, 31 insertions(+), 37 deletions(-) diff --git a/.github/workflows/netlify-deploy-preview.yml b/.github/workflows/netlify-deploy-preview.yml index f27dd404d9..da5ae89f5e 100644 --- a/.github/workflows/netlify-deploy-preview.yml +++ b/.github/workflows/netlify-deploy-preview.yml @@ -5,38 +5,12 @@ on: paths: ['sites/docs/**', 'sites/main-site/**'] jobs: - pre-build: - name: 'prepare build setup' + change-detection: + name: 'detect changed sub-sites' runs-on: ubuntu-latest - defaults: - run: - working-directory: ./website steps: - name: Checkout website repo uses: actions/checkout@v4 - with: - path: ./website - - name: debug - run: | - ls -l . - ls -l .. - pwd - - name: Set up Node.js 20 - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: 'npm' - cache-dependency-path: ./website/package-lock.json - - - name: Install npm deps - run: npm ci - - - name: debug - run: | - ls -l . - ls -l .. - pwd - git status - name: Check changed files id: changed-files-yaml @@ -50,22 +24,30 @@ jobs: 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 defaults: run: working-directory: website - needs: pre-build - if: github.repository == 'nf-core/website' && needs.pre-build.outputs.main-site_any_changed == 'true' + needs: change-detection + if: github.repository == 'nf-core/website' && needs.change-detection.outputs.main-site_any_changed == 'true' permissions: pull-requests: write steps: - - name: debug - run: | - ls -l . - ls -l .. - pwd + - 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' + cache-dependency-path: ./website/package-lock.json + + - name: Install npm deps + run: npm ci - name: Build website run: npm run build --workspace sites/main-site @@ -90,11 +72,23 @@ jobs: defaults: run: working-directory: website - needs: pre-build - if: github.repository == 'nf-core/website' && needs.pre-build.outputs.docs_any_changed == 'true' + 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' + cache-dependency-path: ./website/package-lock.json + + - name: Install npm deps + run: npm ci - name: Build website run: npm run build --workspace sites/docs From d8c332f6ef17b17f5e8e21730c141ffb7cafba43 Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 3 Jul 2024 12:45:50 +0200 Subject: [PATCH 19/21] fix cache path --- .github/workflows/netlify-deploy-preview.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/netlify-deploy-preview.yml b/.github/workflows/netlify-deploy-preview.yml index da5ae89f5e..914161dad0 100644 --- a/.github/workflows/netlify-deploy-preview.yml +++ b/.github/workflows/netlify-deploy-preview.yml @@ -44,7 +44,6 @@ jobs: with: node-version: 20 cache: 'npm' - cache-dependency-path: ./website/package-lock.json - name: Install npm deps run: npm ci @@ -85,7 +84,6 @@ jobs: with: node-version: 20 cache: 'npm' - cache-dependency-path: ./website/package-lock.json - name: Install npm deps run: npm ci From 71a1b0d463efbfbab511793f0d2ecd8a5d3b7da4 Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 3 Jul 2024 12:48:33 +0200 Subject: [PATCH 20/21] don't set wkdir --- .github/workflows/netlify-deploy-preview.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/netlify-deploy-preview.yml b/.github/workflows/netlify-deploy-preview.yml index 914161dad0..4157b8076c 100644 --- a/.github/workflows/netlify-deploy-preview.yml +++ b/.github/workflows/netlify-deploy-preview.yml @@ -28,9 +28,6 @@ jobs: deploy-main-site: name: 'Deploy preview for main-site' runs-on: ubuntu-latest - defaults: - run: - working-directory: website needs: change-detection if: github.repository == 'nf-core/website' && needs.change-detection.outputs.main-site_any_changed == 'true' permissions: @@ -68,9 +65,6 @@ jobs: deploy-docs: name: 'Deploy preview for docs' runs-on: ubuntu-latest - defaults: - run: - working-directory: website needs: change-detection if: github.repository == 'nf-core/website' && needs.change-detection.outputs.docs_any_changed == 'true' permissions: From 92d3af727ef5b6b9e28927ac00a69e9fc679305b Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 3 Jul 2024 13:00:29 +0200 Subject: [PATCH 21/21] retrigger build --- .github/workflows/netlify-deploy-preview.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/netlify-deploy-preview.yml b/.github/workflows/netlify-deploy-preview.yml index 4157b8076c..7cb0f010bb 100644 --- a/.github/workflows/netlify-deploy-preview.yml +++ b/.github/workflows/netlify-deploy-preview.yml @@ -81,6 +81,7 @@ jobs: - name: Install npm deps run: npm ci + - name: Build website run: npm run build --workspace sites/docs