-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90a051d
commit ba10a33
Showing
3 changed files
with
47 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -65,7 +66,7 @@ jobs: | |
if: ${{ always() }} | ||
needs: pkgdown | ||
env: | ||
GITHUB_PAT: ${{ secrets.TOKEN }} | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
|
@@ -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 |