From 784bf81edd4d2df9cad755bfe1253ef827967ce2 Mon Sep 17 00:00:00 2001 From: niclaz <83479948+niclaz@users.noreply.github.com> Date: Thu, 5 Sep 2024 19:35:48 +0200 Subject: [PATCH 01/11] Updated deploy.yml using template actions/upload-artifact --- .github/workflows/deploy.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c645de8..3236e6e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -48,11 +48,15 @@ jobs: deploy: needs: build - runs-on: ubuntu-latest + permissions: + contents: read + pages: write + id-token: write environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action From c6ee5948b4638686fbbf9354cd7dcb2510b36cfb Mon Sep 17 00:00:00 2001 From: niclaz <83479948+niclaz@users.noreply.github.com> Date: Thu, 5 Sep 2024 19:47:44 +0200 Subject: [PATCH 02/11] Create upload-pages-artifact.yaml to have side process for artifact --- .github/workflows/upload-pages-artifact.yaml | 48 ++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/upload-pages-artifact.yaml diff --git a/.github/workflows/upload-pages-artifact.yaml b/.github/workflows/upload-pages-artifact.yaml new file mode 100644 index 0000000..1bec152 --- /dev/null +++ b/.github/workflows/upload-pages-artifact.yaml @@ -0,0 +1,48 @@ +name: "Upload GitHub Pages artifact" +description: "A composite action that prepares your static assets to be deployed to GitHub Pages" +author: "GitHub" +inputs: + name: + description: 'Artifact name' + required: false + default: 'github-pages' + path: + description: "Path of the directory containing the static assets." + required: true + default: "_site/" + retention-days: + description: "Duration after which artifact will expire in days." + required: false + default: "1" +outputs: + artifact_id: + description: "The ID of the artifact that was uploaded." + value: ${{ steps.upload-artifact.outputs.artifact-id }} +runs: + using: composite + steps: + - name: Archive artifact + shell: sh + if: runner.os == 'Linux' + run: | + echo ::group::Archive artifact + tar \ + --dereference --hard-dereference \ + --directory "$INPUT_PATH" \ + -cvf "$RUNNER_TEMP/artifact.tar" \ + --exclude=.git \ + --exclude=.github \ + . + echo ::endgroup:: + env: + INPUT_PATH: ${{ inputs.path }} + + + - name: Upload artifact + id: upload-artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.name }} + path: ${{ runner.temp }}/artifact.tar + retention-days: ${{ inputs.retention-days }} + if-no-files-found: error From 7f0087d2d433b7cb98d80227406d65493b618c83 Mon Sep 17 00:00:00 2001 From: niclaz <83479948+niclaz@users.noreply.github.com> Date: Thu, 5 Sep 2024 19:50:23 +0200 Subject: [PATCH 03/11] Update upload-pages-artifact.yaml - 10 day retention --- .github/workflows/upload-pages-artifact.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upload-pages-artifact.yaml b/.github/workflows/upload-pages-artifact.yaml index 1bec152..9ee0b52 100644 --- a/.github/workflows/upload-pages-artifact.yaml +++ b/.github/workflows/upload-pages-artifact.yaml @@ -13,7 +13,7 @@ inputs: retention-days: description: "Duration after which artifact will expire in days." required: false - default: "1" + default: "10" outputs: artifact_id: description: "The ID of the artifact that was uploaded." From 927cb8f68da3674c40c4f15d3eb89c73ff502a70 Mon Sep 17 00:00:00 2001 From: niclaz <83479948+niclaz@users.noreply.github.com> Date: Thu, 5 Sep 2024 19:50:41 +0200 Subject: [PATCH 04/11] Update deploy.yml to add new workflow --- .github/workflows/deploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3236e6e..1501fa4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -11,6 +11,9 @@ on: workflows: ["Synchronize data"] types: - completed + workflows: ["Upload GitHub Pages artifact"] + types: + - completed # Allow this job to clone the repo and create a page deployment permissions: From 5200f45d7e01538ceb6572de22004cf767be7661 Mon Sep 17 00:00:00 2001 From: niclaz <83479948+niclaz@users.noreply.github.com> Date: Thu, 5 Sep 2024 19:56:03 +0200 Subject: [PATCH 05/11] Bumped version of actions/checkout to v4 in sync.yml --- .github/workflows/sync.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 5edbfeb..2a4a639 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout your repository using git - uses: actions/checkout@v3 + uses: actions/checkout@v4 - uses: denoland/setup-deno@v1 with: @@ -29,4 +29,4 @@ jobs: - uses: EndBug/add-and-commit@v9 with: - default_author: github_actions \ No newline at end of file + default_author: github_actions From c62f9934d6b15f290f8c2316b3950a7473f0ac03 Mon Sep 17 00:00:00 2001 From: niclaz <83479948+niclaz@users.noreply.github.com> Date: Thu, 5 Sep 2024 19:56:55 +0200 Subject: [PATCH 06/11] Update deploy.yml for workflows syntax --- .github/workflows/deploy.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1501fa4..84540da 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,13 +8,10 @@ on: # Allows you to run this workflow manually from the Actions tab on GitHub. workflow_dispatch: workflow_run: - workflows: ["Synchronize data"] + workflows: ["Synchronize data"] ["Upload GitHub Pages artifact"] types: - completed - workflows: ["Upload GitHub Pages artifact"] - types: - - completed - + # Allow this job to clone the repo and create a page deployment permissions: actions: read From e4f5f1268b9e825d1d4a2594f46d5e473b5442ab Mon Sep 17 00:00:00 2001 From: niclaz <83479948+niclaz@users.noreply.github.com> Date: Thu, 5 Sep 2024 20:00:40 +0200 Subject: [PATCH 07/11] added on trigger to the upload-pages-artifact.yaml --- .github/workflows/upload-pages-artifact.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/upload-pages-artifact.yaml b/.github/workflows/upload-pages-artifact.yaml index 9ee0b52..34b8174 100644 --- a/.github/workflows/upload-pages-artifact.yaml +++ b/.github/workflows/upload-pages-artifact.yaml @@ -1,4 +1,13 @@ name: "Upload GitHub Pages artifact" + +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: + description: "A composite action that prepares your static assets to be deployed to GitHub Pages" author: "GitHub" inputs: From d43f02cd343ec2f2cefae19e0b64951eeb18e084 Mon Sep 17 00:00:00 2001 From: niclaz <83479948+niclaz@users.noreply.github.com> Date: Thu, 5 Sep 2024 20:03:47 +0200 Subject: [PATCH 08/11] Delete .github/workflows/upload-pages-artifact.yaml --- .github/workflows/upload-pages-artifact.yaml | 57 -------------------- 1 file changed, 57 deletions(-) delete mode 100644 .github/workflows/upload-pages-artifact.yaml diff --git a/.github/workflows/upload-pages-artifact.yaml b/.github/workflows/upload-pages-artifact.yaml deleted file mode 100644 index 34b8174..0000000 --- a/.github/workflows/upload-pages-artifact.yaml +++ /dev/null @@ -1,57 +0,0 @@ -name: "Upload GitHub Pages artifact" - -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: - -description: "A composite action that prepares your static assets to be deployed to GitHub Pages" -author: "GitHub" -inputs: - name: - description: 'Artifact name' - required: false - default: 'github-pages' - path: - description: "Path of the directory containing the static assets." - required: true - default: "_site/" - retention-days: - description: "Duration after which artifact will expire in days." - required: false - default: "10" -outputs: - artifact_id: - description: "The ID of the artifact that was uploaded." - value: ${{ steps.upload-artifact.outputs.artifact-id }} -runs: - using: composite - steps: - - name: Archive artifact - shell: sh - if: runner.os == 'Linux' - run: | - echo ::group::Archive artifact - tar \ - --dereference --hard-dereference \ - --directory "$INPUT_PATH" \ - -cvf "$RUNNER_TEMP/artifact.tar" \ - --exclude=.git \ - --exclude=.github \ - . - echo ::endgroup:: - env: - INPUT_PATH: ${{ inputs.path }} - - - - name: Upload artifact - id: upload-artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ inputs.name }} - path: ${{ runner.temp }}/artifact.tar - retention-days: ${{ inputs.retention-days }} - if-no-files-found: error From 44a3d4aaa7674bd6e132cbfc69c17647c5aa9dc6 Mon Sep 17 00:00:00 2001 From: niclaz <83479948+niclaz@users.noreply.github.com> Date: Thu, 5 Sep 2024 20:04:19 +0200 Subject: [PATCH 09/11] Reverted recent commits --- .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 84540da..747060f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,7 +8,7 @@ on: # Allows you to run this workflow manually from the Actions tab on GitHub. workflow_dispatch: workflow_run: - workflows: ["Synchronize data"] ["Upload GitHub Pages artifact"] + workflows: ["Synchronize data"] types: - completed From dd992627072a0f72da51fc07b069f82129cfc043 Mon Sep 17 00:00:00 2001 From: niclaz <83479948+niclaz@users.noreply.github.com> Date: Thu, 5 Sep 2024 20:15:04 +0200 Subject: [PATCH 10/11] Adding latest actions/upload-artifact to the deploy.yml --- .github/workflows/deploy.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 747060f..f38efda 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,6 +20,17 @@ 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: w3pn-artifact + path: artifact.txt + build: runs-on: ubuntu-latest steps: From 027fc09f5b5aea67dffb59e11a4c985a4d999417 Mon Sep 17 00:00:00 2001 From: niclaz <83479948+niclaz@users.noreply.github.com> Date: Thu, 5 Sep 2024 20:18:45 +0200 Subject: [PATCH 11/11] renamed variable w3pn-artifact to github-pages --- .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 f38efda..f4240d5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -28,7 +28,7 @@ jobs: - name: Upload Artifact uses: actions/upload-artifact@v4 with: - name: w3pn-artifact + name: github-pages path: artifact.txt build: