From 2e83facca88710a9967ee456006504f09ff9483b Mon Sep 17 00:00:00 2001 From: niclaz <83479948+niclaz@users.noreply.github.com> Date: Thu, 5 Sep 2024 23:04:15 +0200 Subject: [PATCH 1/9] Improving deploy.yml / permission bump --- .github/workflows/deploy.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f4240d5..7c94ca6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,8 +14,8 @@ on: # Allow this job to clone the repo and create a page deployment permissions: - actions: read - contents: read + actions: write + contents: write pages: write id-token: write @@ -60,6 +60,7 @@ jobs: deploy: needs: build permissions: + actions: write contents: read pages: write id-token: write @@ -70,4 +71,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action + uses: actions/deploy-pages@v4 From 3c3a04a926ae70d7b116e7f8dbd73933f876c765 Mon Sep 17 00:00:00 2001 From: niclaz <83479948+niclaz@users.noreply.github.com> Date: Thu, 5 Sep 2024 23:23:39 +0200 Subject: [PATCH 2/9] Adding additional steps to deploy job in the deploy.yaml --- .github/workflows/deploy.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7c94ca6..b4e84c7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,18 +1,14 @@ name: Deploy to GitHub Pages on: - # Trigger the workflow every time you push to the `main` branch - # Using a different branch name? Replace `main` with your branch’s name push: branches: [ main ] - # Allows you to run this workflow manually from the Actions tab on GitHub. workflow_dispatch: workflow_run: workflows: ["Synchronize data"] types: - completed -# Allow this job to clone the repo and create a page deployment permissions: actions: write contents: write @@ -36,24 +32,18 @@ jobs: steps: - name: Checkout your repository using git uses: actions/checkout@v4 - - uses: denoland/setup-deno@v1 with: deno-version: v1.x - - uses: szenius/set-timezone@v2.0 with: timezoneLinux: "Europe/Prague" - - name: Cache run: make cache - - name: Test run: make test - - name: Build bundle run: make build - - name: Add custom domain run: "touch dist/CNAME && echo \"data.web3privacy.info\" >> dist/CNAME" @@ -69,6 +59,15 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + # Upload entire repository + path: '.' - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 From 88d86f545b63fdc662f3a9111101928fad87df2b Mon Sep 17 00:00:00 2001 From: niclaz <83479948+niclaz@users.noreply.github.com> Date: Thu, 5 Sep 2024 23:38:48 +0200 Subject: [PATCH 3/9] Update sync.js to remove 'new' from ClientError --- utils/sync.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/sync.js b/utils/sync.js index 0f60488..33dba47 100644 --- a/utils/sync.js +++ b/utils/sync.js @@ -22,7 +22,7 @@ async function syncResearch () { 'Backlog': 'backlog', } - const client = new GraphQLClient("https://api.github.com/graphql", { + const client = GraphQLClient("https://api.github.com/graphql", { headers: { authorization: `bearer ${Deno.env.get('GITHUB_TOKEN')}`, }, From dfb462ba46ced287a48d5896cc55eaa68ffc0c6b Mon Sep 17 00:00:00 2001 From: niclaz <83479948+niclaz@users.noreply.github.com> Date: Thu, 5 Sep 2024 23:45:14 +0200 Subject: [PATCH 4/9] removed 'upload' job in deploy.yml --- .github/workflows/deploy.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b4e84c7..862be8f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -16,17 +16,6 @@ permissions: id-token: write jobs: - upload: - runs-on: ubuntu-latest - steps: - - name: Creating artifact placeholder file - run: echo "this is a placeholder file" > artifact.txt - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: github-pages - path: artifact.txt - build: runs-on: ubuntu-latest steps: From d4360e4a18ebb3835c21b1e2df5d11e7060659e8 Mon Sep 17 00:00:00 2001 From: niclaz <83479948+niclaz@users.noreply.github.com> Date: Thu, 5 Sep 2024 23:48:49 +0200 Subject: [PATCH 5/9] reverted sync.js commit --- utils/sync.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/sync.js b/utils/sync.js index 33dba47..0f60488 100644 --- a/utils/sync.js +++ b/utils/sync.js @@ -22,7 +22,7 @@ async function syncResearch () { 'Backlog': 'backlog', } - const client = GraphQLClient("https://api.github.com/graphql", { + const client = new GraphQLClient("https://api.github.com/graphql", { headers: { authorization: `bearer ${Deno.env.get('GITHUB_TOKEN')}`, }, From c846385eb857011356a516c16172c64f3188246f Mon Sep 17 00:00:00 2001 From: niclaz <83479948+niclaz@users.noreply.github.com> Date: Fri, 6 Sep 2024 19:54:06 +0200 Subject: [PATCH 6/9] re-added actions/upload-pages-artifact but at v3.0.1 --- .github/workflows/deploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 862be8f..beba570 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -35,6 +35,9 @@ jobs: run: make build - name: Add custom domain run: "touch dist/CNAME && echo \"data.web3privacy.info\" >> dist/CNAME" + - name: Upload GitHub Pages artifact + uses: actions/upload-pages-artifact@v3.0.1 + deploy: needs: build From 4f6187b0bd9551d5540c5e5a12f9688ae4ada39b Mon Sep 17 00:00:00 2001 From: niclaz <83479948+niclaz@users.noreply.github.com> Date: Fri, 6 Sep 2024 19:59:06 +0200 Subject: [PATCH 7/9] Added 'path' to upload-pages-artifact "./dist" --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index beba570..2fa0a22 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -37,8 +37,8 @@ jobs: run: "touch dist/CNAME && echo \"data.web3privacy.info\" >> dist/CNAME" - name: Upload GitHub Pages artifact uses: actions/upload-pages-artifact@v3.0.1 - - + path: ./dist + deploy: needs: build permissions: From 954aa79361970afb29379f313b9cd53e5b6cc180 Mon Sep 17 00:00:00 2001 From: niclaz <83479948+niclaz@users.noreply.github.com> Date: Fri, 6 Sep 2024 20:01:45 +0200 Subject: [PATCH 8/9] Added / to 'path' as referenced in Issue (see comments) https://github.com/actions/upload-pages-artifact/issues/82 --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2fa0a22..ef4287e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -37,7 +37,7 @@ jobs: run: "touch dist/CNAME && echo \"data.web3privacy.info\" >> dist/CNAME" - name: Upload GitHub Pages artifact uses: actions/upload-pages-artifact@v3.0.1 - path: ./dist + path: ./dist/ deploy: needs: build From c44a09484975c8231e2506b3458afed143642978 Mon Sep 17 00:00:00 2001 From: niclaz <83479948+niclaz@users.noreply.github.com> Date: Fri, 6 Sep 2024 20:05:43 +0200 Subject: [PATCH 9/9] udated yaml syntax of './dist/' --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ef4287e..acfc489 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -37,7 +37,7 @@ jobs: run: "touch dist/CNAME && echo \"data.web3privacy.info\" >> dist/CNAME" - name: Upload GitHub Pages artifact uses: actions/upload-pages-artifact@v3.0.1 - path: ./dist/ + path: './dist/' deploy: needs: build