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 b6562a0
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions .github/workflows/render.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ jobs:
needs: pkgdown
env:
GITHUB_PAT: ${{ secrets.TOKEN }}
USER: ${{ secrets.DEPLOY_USER }}
SERVER: ${{ secrets.DEPLOY_HOST }}
REPO: ${{ secrets.DEPLOY_REPOSITORY }}
KEY: ${{ secrets.SSH_PRIVATE_KEY }}
steps:
- uses: actions/checkout@v4

Expand All @@ -84,10 +88,20 @@ jobs:
with:
path: _site

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: true
branch: gh-pages
folder: _site
- name: Deploy
run: |
## Create the SSH directory and give it the right permissions
mkdir -p ~/.ssh
chmod 700 ~/.ssh
## Add the SSH key
echo "${KEY}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
## Use ssh-keyscan to scan the keys of the server
ssh-keyscan -H ${HOST} >> ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
## Push
git remote -v | grep -w production || git remote add production ssh+git://${USER}@${HOST}/${REPO}
git push -f production master
ssh ${USER}@${HOST} deploy ${REPO}
ssh ${USER}@${HOST} clean ${REPO}

0 comments on commit b6562a0

Please sign in to comment.