From 660ea38477f56de91a9140a70353e71f5a019a68 Mon Sep 17 00:00:00 2001 From: nfrerebeau Date: Tue, 27 Aug 2024 14:30:14 +0200 Subject: [PATCH] Update GitHub Actions workflow --- .github/workflows/render.yaml | 52 ++++++++++++++++++++++++++++++++--- .nojekyll | 0 CNAME | 1 - 3 files changed, 48 insertions(+), 5 deletions(-) delete mode 100644 .nojekyll delete mode 100644 CNAME diff --git a/.github/workflows/render.yaml b/.github/workflows/render.yaml index 51cf381..81c11a1 100644 --- a/.github/workflows/render.yaml +++ b/.github/workflows/render.yaml @@ -18,10 +18,54 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 - - name: Install Quarto + - name: Install quarto uses: quarto-dev/quarto-actions/setup@v2 - - name: Publish to GitHub Pages - uses: quarto-dev/quarto-actions/publish@v2 + - name: Render quarto project + uses: quarto-dev/quarto-actions/render@v2 + + - name: Upload website artifacts + uses: actions/upload-artifact@v4 + with: + name: quarto + path: _site + + deploy: + runs-on: ubuntu-latest + needs: quarto + env: + USER: ${{ secrets.DEPLOY_USER }} + SERVER: ${{ secrets.DEPLOY_HOST }} + REPO: ${{ secrets.DEPLOY_REPOSITORY }} + KEY: ${{ secrets.SSH_PRIVATE_KEY }} + steps: + - name: Download website artifacts + uses: actions/download-artifact@v4 with: - target: gh-pages + name: quarto + path: htdocs + + - name: Add SSH key + run: | + mkdir -p ~/.ssh + chmod 700 ~/.ssh + echo "${KEY}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh-keyscan ${SERVER} >> ~/.ssh/known_hosts + chmod 644 ~/.ssh/known_hosts + + - name: Push to production + run: | + git init -b main + git config --global user.email "packages@tesselle.org" + git config --global user.name "tesselle" + git remote add production ssh+git://${USER}@${SERVER}/${REPO} + git add * + git commit -m "Built site" + git push -f production main + + - name: Deploy + run: ssh ${USER}@${SERVER} deploy ${REPO} main + + - name: Clean + run: ssh ${USER}@${SERVER} clean ${REPO} main diff --git a/.nojekyll b/.nojekyll deleted file mode 100644 index e69de29..0000000 diff --git a/CNAME b/CNAME deleted file mode 100644 index 1b7e8da..0000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -www.tesselle.org \ No newline at end of file