Skip to content

Commit

Permalink
Update GitHub Actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrerebeau committed Aug 27, 2024
1 parent 90a051d commit ba10a33
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 9 deletions.
55 changes: 47 additions & 8 deletions .github/workflows/render.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ jobs:
Rscript -e 'utils::install.packages(pkgs = ".", repos = NULL)'
Rscript -e 'pkgdown::build_site_github_pages(pkg = ".", dest_dir = "docs")'
- uses: actions/upload-artifact@v4
- name: Upload pkgdown artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.pkg }}
path: tmp/docs
Expand All @@ -65,7 +66,7 @@ jobs:
if: ${{ always() }}
needs: pkgdown
env:
GITHUB_PAT: ${{ secrets.TOKEN }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4

Expand All @@ -84,10 +85,48 @@ jobs:
with:
path: _site

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
- name: Upload website artifacts
uses: actions/upload-artifact@v4
with:
clean: true
branch: gh-pages
folder: _site
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:
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 "[email protected]"
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
Empty file removed .nojekyll
Empty file.
1 change: 0 additions & 1 deletion CNAME

This file was deleted.

0 comments on commit ba10a33

Please sign in to comment.