From e824b07837eabb6a8bab3ae1b41f63d9ef254568 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 10:59:19 +0200 Subject: [PATCH] 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" \