From 7af76bd914e104e0443f0be2457fd5d48502858c Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Thu, 23 May 2024 22:14:09 +0200 Subject: [PATCH 01/32] Deploy preview site to review pull requests Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll.yaml | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index 4d2a977..0501262 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -8,6 +8,9 @@ on: env: _UID: 1000 _GID: 1000 + BASE_URL: www.lafs.eval.latfa.net + PREFIX: "" + SUFFIX: "" jobs: jekyll: runs-on: ubuntu-22.04 @@ -43,16 +46,41 @@ jobs: run: | docker-compose run --rm -v "${JOB_CONTAINER_NAME}:/site" -w /site \ jekyll build --verbose + continue-on-error: true - name: Prepare ssh key id: prepare_ssh_key if: ${{ gitea.ref == 'refs/heads/main' }} run: | echo "${{ secrets.WWW_DEPLOY_KEY }}" > ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519 - - name: Publish Jekyll site - id: publish_site + - name: Deploy Jekyll site + id: deploy_site if: ${{ gitea.ref == 'refs/heads/main' }} run: | rsync -halvi \ -e "ssh -a -x -o StrictHostKeyChecking=no" \ ./_site/ www@lafs.eval.latfa.net:/var/www/site/ + - name: Comment pull request + id: comment_pull_request + if: gitea.event_name == 'pull_request' + uses: exercism/pr-commenter-action@v1.4.0 + with: + template-variables: | + { + "asciidocOutcome": "${{ steps.asciidoc.outcome }}", + "verifyOutcome": "${{ steps.verify.outcome }}", + "verifyOutputsResult": ${{ toJSON(steps.verify.outputs.result) }}, + "deployOutcome": "${{ steps.deploy.outcome }}", + "deployUrl": "${{ format('{0}/{1}{2}/', env.BASE_URL, env.PREFIX, env.SUFFIX) }}", + "githubActor": "${{ github.actor }}", + "githubEventName": "${{ github.event_name }}", + "githubWorkflow": "${{ github.workflow }}", + "githubRunNumber": "${{ github.run_number }}", + "githubRunAttempt": "${{ github.run_attempt }}" + } + - name: Fail on error + id: fail-on-error + if: | + steps.build_site.outcome != 'success' + || (github.event_name == 'pull_request' && steps.deploy_site.outcome != 'success') + run: exit 1 -- 2.44.1 From f89cb1623cf7ad38764d0fb9263e556297028e43 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Thu, 23 May 2024 22:16:55 +0200 Subject: [PATCH 02/32] Add the template in the legacy GitHub path Signed-off-by: Benoit Donneaux --- .github/pr-commenter.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/pr-commenter.yml diff --git a/.github/pr-commenter.yml b/.github/pr-commenter.yml new file mode 100644 index 0000000..0ef5304 --- /dev/null +++ b/.github/pr-commenter.yml @@ -0,0 +1,35 @@ +comment: + glob-options: + dot: true + snippets: + - id: asciidoc-{{ asciidocOutcome }} + files: + - '**' + body: | + #### :hammer: AsciiDoc conversion `{{ asciidocOutcome }}` + + - id: verify-{{ verifyOutcome }} + files: + - '**' + body: | + #### :mag: Broken link verification `{{ verifyOutcome }}` +
Verification Output + + ``` + {{ verifyOutputsResult }} + ``` + +
+ + - id: deploy-{{ deployOutcome }} + files: + - '**' + body: | + #### :rocket: AsciiDoc deploy `{{ deployOutcome }}` + #### :link: Preview documentation [here]({{ deployUrl }}) + + - id: pusher-{{ githubActor }}-{{ githubEventName }}-{{ githubRunNumber }}-{{ githubRunAttempt }} + files: + - '**' + body: | + *Pusher: @{{ githubActor }}, Action: `{{ githubEventName }}`, Workflow: `{{ githubWorkflow }}`, Run: {{ githubRunNumber }}/{{ githubRunAttempt }}* -- 2.44.1 From 61cb6880c6d872590c592faaee6f3973c3965c3f Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Thu, 23 May 2024 22:28:44 +0200 Subject: [PATCH 03/32] Adapt to Gitea Signed-off-by: Benoit Donneaux --- .gitea/pr-commenter.yml | 35 +++++++++++++++++++++++++++++++++++ .gitea/workflows/jekyll.yaml | 21 +++++++++++---------- .github/pr-commenter.yml | 35 ----------------------------------- 3 files changed, 46 insertions(+), 45 deletions(-) create mode 100644 .gitea/pr-commenter.yml delete mode 100644 .github/pr-commenter.yml diff --git a/.gitea/pr-commenter.yml b/.gitea/pr-commenter.yml new file mode 100644 index 0000000..1e48903 --- /dev/null +++ b/.gitea/pr-commenter.yml @@ -0,0 +1,35 @@ +comment: + glob-options: + dot: true + snippets: + - id: image-{{ imageOutcome }} + files: + - '**' + body: | + #### :hammer: Docker image `{{ imageOutcome }}` + + - id: build-{{ buildOutcome }} + files: + - '**' + body: | + #### :mag: Jekyll build `{{ buildOutcome }}` +
Build Output + + ``` + {{ buildOutputsResult }} + ``` + +
+ + - id: deploy-{{ deployOutcome }} + files: + - '**' + body: | + #### :rocket: Jekyll deploy `{{ deployOutcome }}` + #### :link: Preview documentation [here]({{ deployUrl }}) + + - id: pusher-{{ gitActor }}-{{ gitEventName }}-{{ gitRunNumber }}-{{ gitRunAttempt }} + files: + - '**' + body: | + *Pusher: @{{ gitActor }}, Action: `{{ gitEventName }}`, Workflow: `{{ gitWorkflow }}`, Run: {{ gitRunNumber }}/{{ gitRunAttempt }}* diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index 0501262..9b55852 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -63,21 +63,22 @@ jobs: - name: Comment pull request id: comment_pull_request if: gitea.event_name == 'pull_request' - uses: exercism/pr-commenter-action@v1.4.0 + uses: exercism/pr-commenter-action@v1.5.1 with: template-variables: | { - "asciidocOutcome": "${{ steps.asciidoc.outcome }}", - "verifyOutcome": "${{ steps.verify.outcome }}", - "verifyOutputsResult": ${{ toJSON(steps.verify.outputs.result) }}, - "deployOutcome": "${{ steps.deploy.outcome }}", + "imageOutcome": "${{ steps.build_image.outcome }}", + "buildOutcome": "${{ steps.build_site.outcome }}", + "buildOutputsResult": ${{ toJSON(steps.build_site.outputs.result) }}, + "deployOutcome": "${{ steps.deploy_site.outcome }}", "deployUrl": "${{ format('{0}/{1}{2}/', env.BASE_URL, env.PREFIX, env.SUFFIX) }}", - "githubActor": "${{ github.actor }}", - "githubEventName": "${{ github.event_name }}", - "githubWorkflow": "${{ github.workflow }}", - "githubRunNumber": "${{ github.run_number }}", - "githubRunAttempt": "${{ github.run_attempt }}" + "gitActor": "${{ gitea.actor }}", + "gitEventName": "${{ gitea.event_name }}", + "gitWorkflow": "${{ gitea.workflow }}", + "gitRunNumber": "${{ gitea.run_number }}", + "gitRunAttempt": "${{ gitea.run_attempt }}" } + config-file: ".gitea/pr-commenter.yml" - name: Fail on error id: fail-on-error if: | diff --git a/.github/pr-commenter.yml b/.github/pr-commenter.yml deleted file mode 100644 index 0ef5304..0000000 --- a/.github/pr-commenter.yml +++ /dev/null @@ -1,35 +0,0 @@ -comment: - glob-options: - dot: true - snippets: - - id: asciidoc-{{ asciidocOutcome }} - files: - - '**' - body: | - #### :hammer: AsciiDoc conversion `{{ asciidocOutcome }}` - - - id: verify-{{ verifyOutcome }} - files: - - '**' - body: | - #### :mag: Broken link verification `{{ verifyOutcome }}` -
Verification Output - - ``` - {{ verifyOutputsResult }} - ``` - -
- - - id: deploy-{{ deployOutcome }} - files: - - '**' - body: | - #### :rocket: AsciiDoc deploy `{{ deployOutcome }}` - #### :link: Preview documentation [here]({{ deployUrl }}) - - - id: pusher-{{ githubActor }}-{{ githubEventName }}-{{ githubRunNumber }}-{{ githubRunAttempt }} - files: - - '**' - body: | - *Pusher: @{{ githubActor }}, Action: `{{ githubEventName }}`, Workflow: `{{ githubWorkflow }}`, Run: {{ githubRunNumber }}/{{ githubRunAttempt }}* -- 2.44.1 From 7743cd682ec65b1d094e75e91656c271c65956a1 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Thu, 23 May 2024 22:33:45 +0200 Subject: [PATCH 04/32] Adapt to Gitea even more Signed-off-by: Benoit Donneaux --- .gitea/pr-commenter.yml | 4 ++-- .gitea/workflows/jekyll.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/pr-commenter.yml b/.gitea/pr-commenter.yml index 1e48903..7454f7f 100644 --- a/.gitea/pr-commenter.yml +++ b/.gitea/pr-commenter.yml @@ -28,8 +28,8 @@ comment: #### :rocket: Jekyll deploy `{{ deployOutcome }}` #### :link: Preview documentation [here]({{ deployUrl }}) - - id: pusher-{{ gitActor }}-{{ gitEventName }}-{{ gitRunNumber }}-{{ gitRunAttempt }} + - id: pusher-{{ gitActor }}-{{ gitEventName }}-{{ gitRunNumber }} files: - '**' body: | - *Pusher: @{{ gitActor }}, Action: `{{ gitEventName }}`, Workflow: `{{ gitWorkflow }}`, Run: {{ gitRunNumber }}/{{ gitRunAttempt }}* + *Pusher: @{{ gitActor }}, Action: `{{ gitEventName }}`, Workflow: `{{ gitWorkflow }}`, Run: {{ gitRunNumber }}* diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index 9b55852..fe05d38 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -9,8 +9,8 @@ env: _UID: 1000 _GID: 1000 BASE_URL: www.lafs.eval.latfa.net - PREFIX: "" - SUFFIX: "" + PREFIX: site + SUFFIX: preview jobs: jekyll: runs-on: ubuntu-22.04 -- 2.44.1 From 1d041506fc4b4627dbb1aabf6689f973a2a91921 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Thu, 23 May 2024 22:35:12 +0200 Subject: [PATCH 05/32] Fix URL Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index fe05d38..65188f6 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -8,7 +8,7 @@ on: env: _UID: 1000 _GID: 1000 - BASE_URL: www.lafs.eval.latfa.net + BASE_URL: https://www.lafs.eval.latfa.net PREFIX: site SUFFIX: preview jobs: -- 2.44.1 From 688f3352408a8310a52ee9bdf110e914a0d2fa84 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Thu, 23 May 2024 22:44:42 +0200 Subject: [PATCH 06/32] Test url Signed-off-by: Benoit Donneaux --- .gitea/pr-commenter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/pr-commenter.yml b/.gitea/pr-commenter.yml index 7454f7f..a962975 100644 --- a/.gitea/pr-commenter.yml +++ b/.gitea/pr-commenter.yml @@ -27,6 +27,7 @@ comment: body: | #### :rocket: Jekyll deploy `{{ deployOutcome }}` #### :link: Preview documentation [here]({{ deployUrl }}) + #### :link: Preview documentation [here](https://www.lafs.eval.latfa.net/) - id: pusher-{{ gitActor }}-{{ gitEventName }}-{{ gitRunNumber }} files: -- 2.44.1 From ee742b5291a467a0347c516b6df256974a95ddfa Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Thu, 23 May 2024 22:48:31 +0200 Subject: [PATCH 07/32] Avoid format function for now Signed-off-by: Benoit Donneaux --- .gitea/pr-commenter.yml | 3 +-- .gitea/workflows/jekyll.yaml | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitea/pr-commenter.yml b/.gitea/pr-commenter.yml index a962975..af1b872 100644 --- a/.gitea/pr-commenter.yml +++ b/.gitea/pr-commenter.yml @@ -26,8 +26,7 @@ comment: - '**' body: | #### :rocket: Jekyll deploy `{{ deployOutcome }}` - #### :link: Preview documentation [here]({{ deployUrl }}) - #### :link: Preview documentation [here](https://www.lafs.eval.latfa.net/) + #### :link: Preview documentation [here]({{ deployBaseUrl }}/{{ deployPrefix}}/{{ deploySuffix }}) - id: pusher-{{ gitActor }}-{{ gitEventName }}-{{ gitRunNumber }} files: diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index 65188f6..e2c0c9e 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -71,7 +71,9 @@ jobs: "buildOutcome": "${{ steps.build_site.outcome }}", "buildOutputsResult": ${{ toJSON(steps.build_site.outputs.result) }}, "deployOutcome": "${{ steps.deploy_site.outcome }}", - "deployUrl": "${{ format('{0}/{1}{2}/', env.BASE_URL, env.PREFIX, env.SUFFIX) }}", + "deployBaseUrl": "${{ env.BASE_URL }}", + "deployPrefix": "${{ env.PREFIX }}", + "deploySuffix": "${{ env.SUFFIX }}", "gitActor": "${{ gitea.actor }}", "gitEventName": "${{ gitea.event_name }}", "gitWorkflow": "${{ gitea.workflow }}", -- 2.44.1 From 7ac9feaee4b99c91fc6d63bc428f53f686fb1ccb Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Thu, 23 May 2024 22:51:09 +0200 Subject: [PATCH 08/32] Quote URL Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index e2c0c9e..a0ed0c0 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -8,7 +8,7 @@ on: env: _UID: 1000 _GID: 1000 - BASE_URL: https://www.lafs.eval.latfa.net + BASE_URL: "https://www.lafs.eval.latfa.net" PREFIX: site SUFFIX: preview jobs: -- 2.44.1 From 4d7cfaf6c3ecb9eec1425616da9d65f27c292a83 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Thu, 23 May 2024 22:53:45 +0200 Subject: [PATCH 09/32] Avoid passing the URL Signed-off-by: Benoit Donneaux --- .gitea/pr-commenter.yml | 2 +- .gitea/workflows/jekyll.yaml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitea/pr-commenter.yml b/.gitea/pr-commenter.yml index af1b872..cf534d7 100644 --- a/.gitea/pr-commenter.yml +++ b/.gitea/pr-commenter.yml @@ -26,7 +26,7 @@ comment: - '**' body: | #### :rocket: Jekyll deploy `{{ deployOutcome }}` - #### :link: Preview documentation [here]({{ deployBaseUrl }}/{{ deployPrefix}}/{{ deploySuffix }}) + #### :link: Preview documentation [here](https://www.lafs.eval.latfa.net/{{ deployPrefix}}/{{ deploySuffix }}) - id: pusher-{{ gitActor }}-{{ gitEventName }}-{{ gitRunNumber }} files: diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index a0ed0c0..b752ee8 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -8,7 +8,6 @@ on: env: _UID: 1000 _GID: 1000 - BASE_URL: "https://www.lafs.eval.latfa.net" PREFIX: site SUFFIX: preview jobs: @@ -71,7 +70,6 @@ jobs: "buildOutcome": "${{ steps.build_site.outcome }}", "buildOutputsResult": ${{ toJSON(steps.build_site.outputs.result) }}, "deployOutcome": "${{ steps.deploy_site.outcome }}", - "deployBaseUrl": "${{ env.BASE_URL }}", "deployPrefix": "${{ env.PREFIX }}", "deploySuffix": "${{ env.SUFFIX }}", "gitActor": "${{ gitea.actor }}", -- 2.44.1 From a0d865d21bc4ce85e6d1c64987d2e767891f4699 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 10:12:27 +0200 Subject: [PATCH 10/32] Deploy preview in dedicated root with context per PR Signed-off-by: Benoit Donneaux --- .gitea/pr-commenter.yml | 6 +++--- .gitea/workflows/jekyll.yaml | 29 +++++++++++++++++++++-------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/.gitea/pr-commenter.yml b/.gitea/pr-commenter.yml index cf534d7..5329cf5 100644 --- a/.gitea/pr-commenter.yml +++ b/.gitea/pr-commenter.yml @@ -6,13 +6,13 @@ comment: files: - '**' body: | - #### :hammer: Docker image `{{ imageOutcome }}` + #### :hammer: Docker build `{{ imageOutcome }}` - id: build-{{ buildOutcome }} files: - '**' body: | - #### :mag: Jekyll build `{{ buildOutcome }}` + #### :wrench: Jekyll build `{{ buildOutcome }}`
Build Output ``` @@ -26,7 +26,7 @@ comment: - '**' body: | #### :rocket: Jekyll deploy `{{ deployOutcome }}` - #### :link: Preview documentation [here](https://www.lafs.eval.latfa.net/{{ deployPrefix}}/{{ deploySuffix }}) + #### :link: Preview site [here](https://{{ deployWebHost }}{{ deployWebContext }}) - id: pusher-{{ gitActor }}-{{ gitEventName }}-{{ gitRunNumber }} files: diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index b752ee8..9c5fa1e 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -8,8 +8,9 @@ on: env: _UID: 1000 _GID: 1000 - PREFIX: site - SUFFIX: preview + WEB_DOMAIN: lafs.eval.latfa.net + WEB_USER: www + WEB_DIR: /var/www jobs: jekyll: runs-on: ubuntu-22.04 @@ -54,11 +55,23 @@ jobs: chmod 600 ~/.ssh/id_ed25519 - name: Deploy Jekyll site id: deploy_site - if: ${{ gitea.ref == 'refs/heads/main' }} run: | - rsync -halvi \ + if [ "${{ gitea.ref }}" = 'refs/heads/main' ]; then + WEB_ROOT="${WEB_DIR}/site" + WEB_HOST="www.${WEB_DOMAIN}" + WEB_CONTEXT='/' + else + WEB_ROOT="${WEB_DIR}/preview" + WEB_HOST="preview.${WEB_DOMAIN}" + WEB_CONTEXT='/{{ gitea.event.pull_request.number }}/' + end + # Save those variabes in the environment for the next steps + echo "WEB_HOST=${WEB_HOST}" >> $GITEA_ENV + echo "WEB_CONTEXT=${WEB_CONTEXT}" >> $GITEA_ENV + # Synchronize the local and the remote site + rsync -halvi --delete \ -e "ssh -a -x -o StrictHostKeyChecking=no" \ - ./_site/ www@lafs.eval.latfa.net:/var/www/site/ + "./_site/${WEB_USER}@${WEB_DOMAIN}:${WEB_ROOT}${WEB_CONTEXT}" - name: Comment pull request id: comment_pull_request if: gitea.event_name == 'pull_request' @@ -70,8 +83,8 @@ jobs: "buildOutcome": "${{ steps.build_site.outcome }}", "buildOutputsResult": ${{ toJSON(steps.build_site.outputs.result) }}, "deployOutcome": "${{ steps.deploy_site.outcome }}", - "deployPrefix": "${{ env.PREFIX }}", - "deploySuffix": "${{ env.SUFFIX }}", + "deployWebHost": "${{ env.WEB_HOST }}", + "deployWebContext": "${{ env.WEB_CONTEXT }}", "gitActor": "${{ gitea.actor }}", "gitEventName": "${{ gitea.event_name }}", "gitWorkflow": "${{ gitea.workflow }}", @@ -83,5 +96,5 @@ jobs: id: fail-on-error if: | steps.build_site.outcome != 'success' - || (github.event_name == 'pull_request' && steps.deploy_site.outcome != 'success') + || (gittea.event_name == 'pull_request' && steps.deploy_site.outcome != 'success') run: exit 1 -- 2.44.1 From 2ecd602f481e30c60f36aaa2734443e9e2b1c834 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 10:24:26 +0200 Subject: [PATCH 11/32] Fix deploy script Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index 9c5fa1e..c0d998e 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -63,7 +63,7 @@ jobs: else WEB_ROOT="${WEB_DIR}/preview" WEB_HOST="preview.${WEB_DOMAIN}" - WEB_CONTEXT='/{{ gitea.event.pull_request.number }}/' + WEB_CONTEXT='/${{ gitea.event.pull_request.number }}/' end # Save those variabes in the environment for the next steps echo "WEB_HOST=${WEB_HOST}" >> $GITEA_ENV @@ -71,7 +71,7 @@ jobs: # Synchronize the local and the remote site rsync -halvi --delete \ -e "ssh -a -x -o StrictHostKeyChecking=no" \ - "./_site/${WEB_USER}@${WEB_DOMAIN}:${WEB_ROOT}${WEB_CONTEXT}" + "./_site/" "${WEB_USER}@${WEB_DOMAIN}:${WEB_ROOT}${WEB_CONTEXT}" - name: Comment pull request id: comment_pull_request if: gitea.event_name == 'pull_request' -- 2.44.1 From a136250c18048e9fb8b5ce3a25eaf65246709699 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 10:26:35 +0200 Subject: [PATCH 12/32] Fix bash condition block Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index c0d998e..f6e46ca 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -64,7 +64,7 @@ jobs: WEB_ROOT="${WEB_DIR}/preview" WEB_HOST="preview.${WEB_DOMAIN}" WEB_CONTEXT='/${{ gitea.event.pull_request.number }}/' - end + fi # Save those variabes in the environment for the next steps echo "WEB_HOST=${WEB_HOST}" >> $GITEA_ENV echo "WEB_CONTEXT=${WEB_CONTEXT}" >> $GITEA_ENV -- 2.44.1 From 3de7adb4a60b03e6268d6c4ebef6d7afcaf490c8 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 10:35:11 +0200 Subject: [PATCH 13/32] Fallback on GitHub env? Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index f6e46ca..2385937 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -66,8 +66,8 @@ jobs: WEB_CONTEXT='/${{ gitea.event.pull_request.number }}/' fi # Save those variabes in the environment for the next steps - echo "WEB_HOST=${WEB_HOST}" >> $GITEA_ENV - echo "WEB_CONTEXT=${WEB_CONTEXT}" >> $GITEA_ENV + echo "WEB_HOST=${WEB_HOST}" >> $GITHUB_ENV + echo "WEB_CONTEXT=${WEB_CONTEXT}" >> $GITHUB_ENV # Synchronize the local and the remote site rsync -halvi --delete \ -e "ssh -a -x -o StrictHostKeyChecking=no" \ -- 2.44.1 From 6c0c6216a6d269dc86a8106ff09773e4c6b1df35 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 10:45:48 +0200 Subject: [PATCH 14/32] Test previous rsync args Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index 2385937..d7715ca 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -71,7 +71,9 @@ jobs: # Synchronize the local and the remote site rsync -halvi --delete \ -e "ssh -a -x -o StrictHostKeyChecking=no" \ - "./_site/" "${WEB_USER}@${WEB_DOMAIN}:${WEB_ROOT}${WEB_CONTEXT}" + ./_site/ www@lafs.eval.latfa.net:/var/www/site/ + #"./_site/" "${WEB_USER}@${WEB_DOMAIN}:${WEB_ROOT}${WEB_CONTEXT}" + continue-on-error: true - name: Comment pull request id: comment_pull_request if: gitea.event_name == 'pull_request' -- 2.44.1 From 5ab12dda463a63154976a96fc9f872bdfa8e703b Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 10:48:36 +0200 Subject: [PATCH 15/32] W/o deletion for now Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index d7715ca..f8471ec 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -69,7 +69,7 @@ jobs: echo "WEB_HOST=${WEB_HOST}" >> $GITHUB_ENV echo "WEB_CONTEXT=${WEB_CONTEXT}" >> $GITHUB_ENV # Synchronize the local and the remote site - rsync -halvi --delete \ + rsync -halvi \ -e "ssh -a -x -o StrictHostKeyChecking=no" \ ./_site/ www@lafs.eval.latfa.net:/var/www/site/ #"./_site/" "${WEB_USER}@${WEB_DOMAIN}:${WEB_ROOT}${WEB_CONTEXT}" -- 2.44.1 From 279a9dd94ff1be5c6954cb398892d368e346f7dd Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 10:54:36 +0200 Subject: [PATCH 16/32] This should work, but does not! Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index f8471ec..fb1d4cf 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -69,10 +69,9 @@ jobs: echo "WEB_HOST=${WEB_HOST}" >> $GITHUB_ENV echo "WEB_CONTEXT=${WEB_CONTEXT}" >> $GITHUB_ENV # Synchronize the local and the remote site - rsync -halvi \ + rsync -halvi --delete \ -e "ssh -a -x -o StrictHostKeyChecking=no" \ - ./_site/ www@lafs.eval.latfa.net:/var/www/site/ - #"./_site/" "${WEB_USER}@${WEB_DOMAIN}:${WEB_ROOT}${WEB_CONTEXT}" + ./_site/ "${WEB_USER}@${WEB_DOMAIN}:${WEB_ROOT}${WEB_CONTEXT}" continue-on-error: true - name: Comment pull request id: comment_pull_request -- 2.44.1 From 41145ffb89ad51cf47a3ef1b3d2c3b556933240a Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 10:56:01 +0200 Subject: [PATCH 17/32] Try rsync before deploying Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index fb1d4cf..6f9df58 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -53,6 +53,9 @@ jobs: run: | echo "${{ secrets.WWW_DEPLOY_KEY }}" > ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519 + rsync -n -halvi \ + -e "ssh -a -x -o StrictHostKeyChecking=no" \ + ./_site/ www@lafs.eval.latfa.net:/var/www/site/ - name: Deploy Jekyll site id: deploy_site run: | -- 2.44.1 From e824b07837eabb6a8bab3ae1b41f63d9ef254568 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 10:59:19 +0200 Subject: [PATCH 18/32] Prepare ssh key just before deploying Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll.yaml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index 6f9df58..65ca373 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -47,15 +47,6 @@ jobs: docker-compose run --rm -v "${JOB_CONTAINER_NAME}:/site" -w /site \ jekyll build --verbose continue-on-error: true - - name: Prepare ssh key - id: prepare_ssh_key - if: ${{ gitea.ref == 'refs/heads/main' }} - run: | - echo "${{ secrets.WWW_DEPLOY_KEY }}" > ~/.ssh/id_ed25519 - chmod 600 ~/.ssh/id_ed25519 - rsync -n -halvi \ - -e "ssh -a -x -o StrictHostKeyChecking=no" \ - ./_site/ www@lafs.eval.latfa.net:/var/www/site/ - name: Deploy Jekyll site id: deploy_site run: | @@ -71,6 +62,9 @@ jobs: # Save those variabes in the environment for the next steps echo "WEB_HOST=${WEB_HOST}" >> $GITHUB_ENV echo "WEB_CONTEXT=${WEB_CONTEXT}" >> $GITHUB_ENV + # Prepare ssh key + echo "${{ secrets.WWW_DEPLOY_KEY }}" > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 # Synchronize the local and the remote site rsync -halvi --delete \ -e "ssh -a -x -o StrictHostKeyChecking=no" \ -- 2.44.1 From c3255a0018a56756d9e8208eadbaccfd9aa8ac07 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 12:12:10 +0200 Subject: [PATCH 19/32] Add relative_url filter for preview context Signed-off-by: Benoit Donneaux --- src/_includes/head/custom.html | 2 +- src/_posts/2020-09-08-welcome.md | 2 +- src/_posts/2020-09-09-post-1.md | 2 +- src/_posts/2020-09-09-post-2.md | 2 +- src/_posts/2020-09-09-post-3.md | 2 +- src/index.html | 18 +++++++++--------- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/_includes/head/custom.html b/src/_includes/head/custom.html index 7c8dfb6..5e10b2f 100644 --- a/src/_includes/head/custom.html +++ b/src/_includes/head/custom.html @@ -1,5 +1,5 @@ - + diff --git a/src/_posts/2020-09-08-welcome.md b/src/_posts/2020-09-08-welcome.md index ce89063..cce91e7 100644 --- a/src/_posts/2020-09-08-welcome.md +++ b/src/_posts/2020-09-08-welcome.md @@ -6,7 +6,7 @@ excerpt: "Welcome to Dummy Jekyll" header: teaser: /assets/images/posts/unsplash-welcome.jpg gallery: - - image_path: assets/images/posts/unsplash-welcome.jpg + - image_path: /assets/images/posts/unsplash-welcome.jpg alt: "welcome" --- {% include gallery %} diff --git a/src/_posts/2020-09-09-post-1.md b/src/_posts/2020-09-09-post-1.md index 48f60a0..9f4c0e2 100644 --- a/src/_posts/2020-09-09-post-1.md +++ b/src/_posts/2020-09-09-post-1.md @@ -6,7 +6,7 @@ excerpt: "This is a generic post." header: teaser: /assets/images/posts/unsplash-post.jpg gallery: - - image_path: assets/images/posts/unsplash-post.jpg + - image_path: /assets/images/posts/unsplash-post.jpg alt: "post" --- {% include gallery %} diff --git a/src/_posts/2020-09-09-post-2.md b/src/_posts/2020-09-09-post-2.md index 934085c..5342ecb 100644 --- a/src/_posts/2020-09-09-post-2.md +++ b/src/_posts/2020-09-09-post-2.md @@ -6,7 +6,7 @@ excerpt: "This is a generic post." header: teaser: /assets/images/posts/unsplash-post.jpg gallery: - - image_path: assets/images/posts/unsplash-post.jpg + - image_path: /assets/images/posts/unsplash-post.jpg alt: "post" --- {% include gallery %} diff --git a/src/_posts/2020-09-09-post-3.md b/src/_posts/2020-09-09-post-3.md index f67d87a..73b2f3d 100644 --- a/src/_posts/2020-09-09-post-3.md +++ b/src/_posts/2020-09-09-post-3.md @@ -6,7 +6,7 @@ excerpt: "This is a generic post." header: teaser: /assets/images/posts/unsplash-post.jpg gallery: - - image_path: assets/images/posts/unsplash-post.jpg + - image_path: /assets/images/posts/unsplash-post.jpg alt: "post" --- {% include gallery %} diff --git a/src/index.html b/src/index.html index f3d4db2..9ce4766 100644 --- a/src/index.html +++ b/src/index.html @@ -17,14 +17,14 @@ excerpt: "Tahoe-LAFS is a Free and Open decentralized cloud storage system. documentation: - title: "Welcome The Least-Authority File Store" documentation_list: - - image_path: /assets/images/overview.png + - image_path: {{ /assets/images/overview.png | relative_url }} alt: "overview" title: "Overview" excerpt: "A one-page summary explains the unique properties of this system." url: "https://tahoe-lafs.readthedocs.io/en/latest/about-tahoe.html" btn_label: "Read More" btn_class: "btn--primary" - - image_path: assets/images/manual.jpg + - image_path: {{ /assets/images/manual.jpg | relative_url }} image_caption: "Image courtesy of [Unsplash](https://unsplash.com/)" alt: "manual" title: "Manual" @@ -32,7 +32,7 @@ documentation_list: url: "https://tahoe-lafs.readthedocs.io/" btn_label: "Read More" btn_class: "btn--primary" - - image_path: /assets/images/wiki.jpg + - image_path: {{ /assets/images/wiki.jpg | relative_url }} image_caption: "Image courtesy of [Unsplash](https://unsplash.com/)" alt: "wiki" title: "Wiki" @@ -44,7 +44,7 @@ contribute: - title: "Get Involved" excerpt: "" contribute_list: - - image_path: assets/images/mailing.jpg + - image_path: {{ /assets/images/mailing.jpg | relative_url }} image_caption: "Image courtesy of [Unsplash](https://unsplash.com/)" alt: "mailing" title: "Mailing list" @@ -52,7 +52,7 @@ contribute_list: url: "https://lists.tahoe-lafs.org/mailman/listinfo/tahoe-dev" btn_label: "Subscribe" btn_class: "btn--primary" - - image_path: /assets/images/messaging.jpg + - image_path: {{ /assets/images/messaging.jpg | relative_url }} image_caption: "Image courtesy of [Unsplash](https://unsplash.com/)" alt: "messaging" title: "Instant messaging" @@ -60,7 +60,7 @@ contribute_list: url: "https://libera.chat/" btn_label: "Chat" btn_class: "btn--primary" - - image_path: /assets/images/meet.jpg + - image_path: {{ /assets/images/meet.jpg | relative_url }} image_caption: "Image courtesy of [Unsplash](https://unsplash.com/)" alt: "meet" title: "Meeting" @@ -72,7 +72,7 @@ blog: - title: "News" excerpt: "Find here under a list of the latest articles on the subjects that matter for us." about: - - image_path: /assets/images/volunteers.jpg + - image_path: {{ /assets/images/volunteers.jpg | relative_url }} image_caption: "Image courtesy of [Unsplash](https://unsplash.com/)" alt: "about image" title: "Volunteers" @@ -96,10 +96,10 @@ about:
-- 2.44.1 From 6081093f2dd8dd31733ff64aab62b487b4e0542e Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 12:27:23 +0200 Subject: [PATCH 20/32] Overwrite baseurl for preview Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll.yaml | 4 ++++ src/index.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index 65ca373..86a8b14 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -44,6 +44,10 @@ jobs: - name: Build Jekyll site id: build_site run: | + # Overwrite the baseurl for previewonly + if [ "${{ gitea.event }}" = 'pull_request' ]; then + sed -i -r -e 's/^baseurl:\s*"([^"]*)"/baseurl: "\1\/${{ gitea.event.pull_request.number }}"/' _config.yml + fi docker-compose run --rm -v "${JOB_CONTAINER_NAME}:/site" -w /site \ jekyll build --verbose continue-on-error: true diff --git a/src/index.html b/src/index.html index 9ce4766..41d676b 100644 --- a/src/index.html +++ b/src/index.html @@ -5,7 +5,7 @@ author_profile: false header: overlay_color: "#000" overlay_filter: "0.4" - overlay_image: /assets/images/overlay.jpg + overlay_image: {{ /assets/images/overlay.jpg | relative_url }} actions: - label: "Download" url: "https://tahoe-lafs.org/downloads" -- 2.44.1 From 3ec0bdf4fcc0b3001982dd9e7953ce47e33976d0 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 12:30:47 +0200 Subject: [PATCH 21/32] Show baseurl when overwritting Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index 86a8b14..0595c39 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -46,7 +46,9 @@ jobs: run: | # Overwrite the baseurl for previewonly if [ "${{ gitea.event }}" = 'pull_request' ]; then + echo "Overwriting baseurl for pull_request ${{ gitea.event.pull_request.number }}" sed -i -r -e 's/^baseurl:\s*"([^"]*)"/baseurl: "\1\/${{ gitea.event.pull_request.number }}"/' _config.yml + grep "baseurl:" _config.yml fi docker-compose run --rm -v "${JOB_CONTAINER_NAME}:/site" -w /site \ jekyll build --verbose -- 2.44.1 From 863e8de0d317f05ba7f91e47d4f4230411a72f69 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 12:33:19 +0200 Subject: [PATCH 22/32] Fix condition Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index 0595c39..cef22f8 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -45,7 +45,7 @@ jobs: id: build_site run: | # Overwrite the baseurl for previewonly - if [ "${{ gitea.event }}" = 'pull_request' ]; then + if [ "${{ gitea.event_name }}" = 'pull_request' ]; then echo "Overwriting baseurl for pull_request ${{ gitea.event.pull_request.number }}" sed -i -r -e 's/^baseurl:\s*"([^"]*)"/baseurl: "\1\/${{ gitea.event.pull_request.number }}"/' _config.yml grep "baseurl:" _config.yml @@ -100,5 +100,5 @@ jobs: id: fail-on-error if: | steps.build_site.outcome != 'success' - || (gittea.event_name == 'pull_request' && steps.deploy_site.outcome != 'success') + || steps.deploy_site.outcome != 'success' run: exit 1 -- 2.44.1 From 4d469b8b57586aecdba7e9454961d60f1a87266e Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 12:34:27 +0200 Subject: [PATCH 23/32] Show only baseurl Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index cef22f8..80fcd74 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -48,7 +48,7 @@ jobs: if [ "${{ gitea.event_name }}" = 'pull_request' ]; then echo "Overwriting baseurl for pull_request ${{ gitea.event.pull_request.number }}" sed -i -r -e 's/^baseurl:\s*"([^"]*)"/baseurl: "\1\/${{ gitea.event.pull_request.number }}"/' _config.yml - grep "baseurl:" _config.yml + grep "^baseurl:" _config.yml fi docker-compose run --rm -v "${JOB_CONTAINER_NAME}:/site" -w /site \ jekyll build --verbose -- 2.44.1 From 29b2069ed911852ec88e6a0fda0667c1b8c43fe0 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 12:39:03 +0200 Subject: [PATCH 24/32] Remove relative_url filter from index.html Signed-off-by: Benoit Donneaux --- src/index.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/index.html b/src/index.html index 41d676b..66e8f22 100644 --- a/src/index.html +++ b/src/index.html @@ -5,7 +5,7 @@ author_profile: false header: overlay_color: "#000" overlay_filter: "0.4" - overlay_image: {{ /assets/images/overlay.jpg | relative_url }} + overlay_image: /assets/images/overlay.jpg actions: - label: "Download" url: "https://tahoe-lafs.org/downloads" @@ -17,14 +17,14 @@ excerpt: "Tahoe-LAFS is a Free and Open decentralized cloud storage system. documentation: - title: "Welcome The Least-Authority File Store" documentation_list: - - image_path: {{ /assets/images/overview.png | relative_url }} + - image_path: /assets/images/overview.png alt: "overview" title: "Overview" excerpt: "A one-page summary explains the unique properties of this system." url: "https://tahoe-lafs.readthedocs.io/en/latest/about-tahoe.html" btn_label: "Read More" btn_class: "btn--primary" - - image_path: {{ /assets/images/manual.jpg | relative_url }} + - image_path: /assets/images/manual.jpg image_caption: "Image courtesy of [Unsplash](https://unsplash.com/)" alt: "manual" title: "Manual" @@ -32,7 +32,7 @@ documentation_list: url: "https://tahoe-lafs.readthedocs.io/" btn_label: "Read More" btn_class: "btn--primary" - - image_path: {{ /assets/images/wiki.jpg | relative_url }} + - image_path: /assets/images/wiki.jpg image_caption: "Image courtesy of [Unsplash](https://unsplash.com/)" alt: "wiki" title: "Wiki" @@ -44,7 +44,7 @@ contribute: - title: "Get Involved" excerpt: "" contribute_list: - - image_path: {{ /assets/images/mailing.jpg | relative_url }} + - image_path: /assets/images/mailing.jpg image_caption: "Image courtesy of [Unsplash](https://unsplash.com/)" alt: "mailing" title: "Mailing list" @@ -52,7 +52,7 @@ contribute_list: url: "https://lists.tahoe-lafs.org/mailman/listinfo/tahoe-dev" btn_label: "Subscribe" btn_class: "btn--primary" - - image_path: {{ /assets/images/messaging.jpg | relative_url }} + - image_path: /assets/images/messaging.jpg image_caption: "Image courtesy of [Unsplash](https://unsplash.com/)" alt: "messaging" title: "Instant messaging" @@ -60,7 +60,7 @@ contribute_list: url: "https://libera.chat/" btn_label: "Chat" btn_class: "btn--primary" - - image_path: {{ /assets/images/meet.jpg | relative_url }} + - image_path: /assets/images/meet.jpg image_caption: "Image courtesy of [Unsplash](https://unsplash.com/)" alt: "meet" title: "Meeting" @@ -72,7 +72,7 @@ blog: - title: "News" excerpt: "Find here under a list of the latest articles on the subjects that matter for us." about: - - image_path: {{ /assets/images/volunteers.jpg | relative_url }} + - image_path: /assets/images/volunteers.jpg image_caption: "Image courtesy of [Unsplash](https://unsplash.com/)" alt: "about image" title: "Volunteers" -- 2.44.1 From 2908a8d930fc92abbc249ae70edc207c65c0fc12 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 12:41:16 +0200 Subject: [PATCH 25/32] Remove relative_url iter for favico too Signed-off-by: Benoit Donneaux --- src/_includes/head/custom.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_includes/head/custom.html b/src/_includes/head/custom.html index 5e10b2f..7c8dfb6 100644 --- a/src/_includes/head/custom.html +++ b/src/_includes/head/custom.html @@ -1,5 +1,5 @@ - + -- 2.44.1 From 0c695236f403cd1626fea45287a24e95224afb47 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 12:43:38 +0200 Subject: [PATCH 26/32] Relative path to favico Signed-off-by: Benoit Donneaux --- src/_includes/head/custom.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_includes/head/custom.html b/src/_includes/head/custom.html index 7c8dfb6..a1eb2e8 100644 --- a/src/_includes/head/custom.html +++ b/src/_includes/head/custom.html @@ -1,5 +1,5 @@ - + -- 2.44.1 From f38cd4b6bcbca1092fd5c197197c208e9776d9f2 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 12:45:32 +0200 Subject: [PATCH 27/32] Relative path for css too Signed-off-by: Benoit Donneaux --- src/_sass/_custom.scss | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/_sass/_custom.scss b/src/_sass/_custom.scss index d80b434..188f5c9 100644 --- a/src/_sass/_custom.scss +++ b/src/_sass/_custom.scss @@ -12,24 +12,24 @@ }*/ /* .page__hero--overlay { - background: url(/assets/images/pattern-4.gif) repeat left top; + background: url(assets/images/pattern-4.gif) repeat left top; } */ .initial-content { //position: relative; //top: 70px; - background: url(/assets/images/pattern-1.png) repeat left top; + background: url(assets/images/pattern-1.png) repeat left top; } /* #about { - background: url(/assets/images/pattern-2.gif) repeat left top; + background: url(assets/images/pattern-2.gif) repeat left top; } @font-face { font-family: "homestead_regularregular"; font-style: normal; font-weight: normal; - src: url("/assets/fonts/homestead-regular-webfont.woff") format("woff"); + src: url("assets/fonts/homestead-regular-webfont.woff") format("woff"); } h1, h2, h3, h4, h5, h6, .archive__item-title, .masthead__inner-wrap { @@ -44,4 +44,4 @@ h1, h2, h3, h4, h5, h6, .archive__item-title, .masthead__inner-wrap { .archive__item-excerpt { color: #a9862b; } -*/ \ No newline at end of file +*/ -- 2.44.1 From d2c7588767bf6ac3627118b15bab6126bf99b304 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 12:48:34 +0200 Subject: [PATCH 28/32] Try very relative for CSS assets Signed-off-by: Benoit Donneaux --- src/_sass/_custom.scss | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/_sass/_custom.scss b/src/_sass/_custom.scss index 188f5c9..42ff92a 100644 --- a/src/_sass/_custom.scss +++ b/src/_sass/_custom.scss @@ -12,24 +12,24 @@ }*/ /* .page__hero--overlay { - background: url(assets/images/pattern-4.gif) repeat left top; + background: url(../images/pattern-4.gif) repeat left top; } */ .initial-content { //position: relative; //top: 70px; - background: url(assets/images/pattern-1.png) repeat left top; + background: url(../images/pattern-1.png) repeat left top; } /* #about { - background: url(assets/images/pattern-2.gif) repeat left top; + background: url(../images/pattern-2.gif) repeat left top; } @font-face { font-family: "homestead_regularregular"; font-style: normal; font-weight: normal; - src: url("assets/fonts/homestead-regular-webfont.woff") format("woff"); + src: url("../fonts/homestead-regular-webfont.woff") format("woff"); } h1, h2, h3, h4, h5, h6, .archive__item-title, .masthead__inner-wrap { -- 2.44.1 From daf2ed519032652fb9cad457f531c7dcc4c00209 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 12:53:27 +0200 Subject: [PATCH 29/32] Improve step error conditions Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll.yaml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index 80fcd74..fa4111f 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -52,7 +52,6 @@ jobs: fi docker-compose run --rm -v "${JOB_CONTAINER_NAME}:/site" -w /site \ jekyll build --verbose - continue-on-error: true - name: Deploy Jekyll site id: deploy_site run: | @@ -75,10 +74,9 @@ jobs: rsync -halvi --delete \ -e "ssh -a -x -o StrictHostKeyChecking=no" \ ./_site/ "${WEB_USER}@${WEB_DOMAIN}:${WEB_ROOT}${WEB_CONTEXT}" - continue-on-error: true - name: Comment pull request id: comment_pull_request - if: gitea.event_name == 'pull_request' + if: ${{ always() && gitea.event_name == 'pull_request' }} uses: exercism/pr-commenter-action@v1.5.1 with: template-variables: | @@ -96,9 +94,3 @@ jobs: "gitRunAttempt": "${{ gitea.run_attempt }}" } config-file: ".gitea/pr-commenter.yml" - - name: Fail on error - id: fail-on-error - if: | - steps.build_site.outcome != 'success' - || steps.deploy_site.outcome != 'success' - run: exit 1 -- 2.44.1 From 531e50d97ff43a62a9d067776472f33a86ab7c41 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 12:53:52 +0200 Subject: [PATCH 30/32] Do not print build output for now Signed-off-by: Benoit Donneaux --- .gitea/pr-commenter.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/pr-commenter.yml b/.gitea/pr-commenter.yml index 5329cf5..b84b8c5 100644 --- a/.gitea/pr-commenter.yml +++ b/.gitea/pr-commenter.yml @@ -13,13 +13,13 @@ comment: - '**' body: | #### :wrench: Jekyll build `{{ buildOutcome }}` -
Build Output + Build Output ``` {{ buildOutputsResult }} ``` -
+
--> - id: deploy-{{ deployOutcome }} files: -- 2.44.1 From a9ad6f677142e26eb992a54e3fb368db86639ff6 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 12:55:29 +0200 Subject: [PATCH 31/32] Remove build output entirely Signed-off-by: Benoit Donneaux --- .gitea/pr-commenter.yml | 7 ------- .gitea/workflows/jekyll.yaml | 1 - 2 files changed, 8 deletions(-) diff --git a/.gitea/pr-commenter.yml b/.gitea/pr-commenter.yml index b84b8c5..d96f23b 100644 --- a/.gitea/pr-commenter.yml +++ b/.gitea/pr-commenter.yml @@ -13,13 +13,6 @@ comment: - '**' body: | #### :wrench: Jekyll build `{{ buildOutcome }}` - Build Output - - ``` - {{ buildOutputsResult }} - ``` - - --> - id: deploy-{{ deployOutcome }} files: diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index fa4111f..dc24ffa 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -83,7 +83,6 @@ jobs: { "imageOutcome": "${{ steps.build_image.outcome }}", "buildOutcome": "${{ steps.build_site.outcome }}", - "buildOutputsResult": ${{ toJSON(steps.build_site.outputs.result) }}, "deployOutcome": "${{ steps.deploy_site.outcome }}", "deployWebHost": "${{ env.WEB_HOST }}", "deployWebContext": "${{ env.WEB_CONTEXT }}", -- 2.44.1 From c1243b7a27d50db6cba3d7ac403828de79b21ddb Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 13:06:38 +0200 Subject: [PATCH 32/32] Add a cleanup workflow Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll_cleanup.yml | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .gitea/workflows/jekyll_cleanup.yml diff --git a/.gitea/workflows/jekyll_cleanup.yml b/.gitea/workflows/jekyll_cleanup.yml new file mode 100644 index 0000000..74606dc --- /dev/null +++ b/.gitea/workflows/jekyll_cleanup.yml @@ -0,0 +1,30 @@ +name: Jekyll cleanup + +# only trigger on pull request closed events +on: + pull_request: + types: [ closed ] + +env: + WEB_DOMAIN: lafs.eval.latfa.net + WEB_USER: www + WEB_ROOT: /var/www/preview + WEB_CONTEXT: "/${{ gitea.event.pull_request.number }}/" +jobs: + jekyll_cleanup: + runs-on: ubuntu-22.04 + permissions: + pull-requests: write + actions: read + contents: read + steps: + - name: Cleanup Jeyll preview + id: cleanup_preview + run: | + # Prepare ssh key + echo "${{ secrets.WWW_DEPLOY_KEY }}" > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 + # Delete preview context from the remote site + sudo apt install -y lftp + echo -e "set sftp:connect-program ssh -a -x -o StrictHostKeyChecking=no; rm -r -f ${WEB_ROOT}${WEB_CONTEXT}\nbye" \ + | lftp sftp://${WEB_USER}:unused@${WEB_DOMAN} -- 2.44.1