From c4052eaf9e00908511efe5885269e6004aa4245d Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Thu, 23 May 2024 20:20:40 +0200 Subject: [PATCH 1/7] Add step to continously deploy the Jekyll site Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index 36053cc..b260c2b 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -43,3 +43,14 @@ jobs: run: | docker-compose run --rm -v "${JOB_CONTAINER_NAME}:/site" -w /site \ jekyll build --verbose + - name: Load ssh key + id: load_ssh_key + #if: ${{ github.ref == 'main' }} + uses: LeastAuthority/ssh-agent-action@v1 + with: + private_key: ${{ secrets.WWW_DEPLOY_KEY }} + - name: Publish Jekyll site + id: publish_site + #if: ${{ github.ref == 'main' }} + run: | + rsync -halvi -e "ssh -a -x -o StrictHostKeyChecking=no" ./_site/ www@lafs.eval.latfa.net:/var/www/site/ -- 2.44.1 From eaa1f1fb8542f22dd1377c36e18a3bde4fd132ea Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Thu, 23 May 2024 21:16:26 +0200 Subject: [PATCH 2/7] Ensure uuidgen is installed to call the action 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 b260c2b..48521aa 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -23,7 +23,7 @@ jobs: id: install_docker run: | apt-get -q update - apt-get -q install -y docker-compose + apt-get -q install -y docker-compose uuid-runtime apt-get -q clean - name: Verify docker id: verify_docker -- 2.44.1 From 113b5fc6adea68c61c8e20ba47dd4bb322066b3f Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Thu, 23 May 2024 21:24:10 +0200 Subject: [PATCH 3/7] Avoid external actions for now Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index 48521aa..de2bf5c 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -23,7 +23,7 @@ jobs: id: install_docker run: | apt-get -q update - apt-get -q install -y docker-compose uuid-runtime + apt-get -q install -y docker-compose apt-get -q clean - name: Verify docker id: verify_docker @@ -46,11 +46,13 @@ jobs: - name: Load ssh key id: load_ssh_key #if: ${{ github.ref == 'main' }} - uses: LeastAuthority/ssh-agent-action@v1 - with: - private_key: ${{ secrets.WWW_DEPLOY_KEY }} + run: | + echo "${{ secrets.WWW_DEPLOY_KEY }}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh-add ~/.ssh/id_rsa - name: Publish Jekyll site id: publish_site #if: ${{ github.ref == 'main' }} run: | - rsync -halvi -e "ssh -a -x -o StrictHostKeyChecking=no" ./_site/ www@lafs.eval.latfa.net:/var/www/site/ + rsync -halvi -e "ssh -a -x -o StrictHostKeyChecking=no" \ + ./_site/ www@lafs.eval.latfa.net:/var/www/site/ -- 2.44.1 From 5ea0004940a4358c5acc068aa84ce5b4bfa1a752 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Thu, 23 May 2024 21:26:29 +0200 Subject: [PATCH 4/7] Avoid ssh agent for now Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index de2bf5c..c9bd139 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -47,12 +47,12 @@ jobs: id: load_ssh_key #if: ${{ github.ref == 'main' }} run: | - echo "${{ secrets.WWW_DEPLOY_KEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh-add ~/.ssh/id_rsa + echo "${{ secrets.WWW_DEPLOY_KEY }}" > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 - name: Publish Jekyll site id: publish_site #if: ${{ github.ref == 'main' }} run: | - rsync -halvi -e "ssh -a -x -o StrictHostKeyChecking=no" \ - ./_site/ www@lafs.eval.latfa.net:/var/www/site/ + rsync -halvi \ + -e "ssh -e ~/.ssh/id_ed25519 -a -x -o StrictHostKeyChecking=no" \ + ./_site/ www@lafs.eval.latfa.net:/var/www/site/ -- 2.44.1 From 2acc2b43469c06cf9ec44288fc7885a4d9c37d1b Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Thu, 23 May 2024 21:28:26 +0200 Subject: [PATCH 5/7] Install rsync package Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index c9bd139..8a2ef55 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -19,11 +19,11 @@ jobs: id: file_ownership run: | chown -R ${_UID}:${_GID} . - - name: Install docker - id: install_docker + - name: Install requirements + id: install_requirements run: | apt-get -q update - apt-get -q install -y docker-compose + apt-get -q install -y docker-compose rsync apt-get -q clean - name: Verify docker id: verify_docker -- 2.44.1 From 83ca189fc91c9c44fe216eb276ba5949da872dac Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Thu, 23 May 2024 21:30:07 +0200 Subject: [PATCH 6/7] Fix ssh key arg Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index 8a2ef55..1f06552 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -43,8 +43,8 @@ jobs: run: | docker-compose run --rm -v "${JOB_CONTAINER_NAME}:/site" -w /site \ jekyll build --verbose - - name: Load ssh key - id: load_ssh_key + - name: Prepare ssh key + id: prepare_ssh_key #if: ${{ github.ref == 'main' }} run: | echo "${{ secrets.WWW_DEPLOY_KEY }}" > ~/.ssh/id_ed25519 @@ -54,5 +54,5 @@ jobs: #if: ${{ github.ref == 'main' }} run: | rsync -halvi \ - -e "ssh -e ~/.ssh/id_ed25519 -a -x -o StrictHostKeyChecking=no" \ + -e "ssh -a -x -o StrictHostKeyChecking=no" \ ./_site/ www@lafs.eval.latfa.net:/var/www/site/ -- 2.44.1 From b2b82838a6e5b1ce78a8ebb9f77596a1caa79600 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Thu, 23 May 2024 21:31:40 +0200 Subject: [PATCH 7/7] Publish only from the main branch 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 1f06552..b14aff8 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -45,13 +45,13 @@ jobs: jekyll build --verbose - name: Prepare ssh key id: prepare_ssh_key - #if: ${{ github.ref == 'main' }} + if: ${{ github.ref == 'main' }} run: | echo "${{ secrets.WWW_DEPLOY_KEY }}" > ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519 - name: Publish Jekyll site id: publish_site - #if: ${{ github.ref == 'main' }} + if: ${{ github.ref == 'main' }} run: | rsync -halvi \ -e "ssh -a -x -o StrictHostKeyChecking=no" \ -- 2.44.1