-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
1 changed file
with
12 additions
and
13 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 |
---|---|---|
|
@@ -13,8 +13,16 @@ jobs: | |
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ssh-key: ${{ secrets.RENDER_KEY }} # Deployment key from your secrets | ||
persist-credentials: false # Prevent GitHub Actions from overwriting credentials | ||
ssh-key: ${{ secrets.RENDER_KEY }} | ||
|
||
- name: Set up SSH for Git | ||
run: | | ||
mkdir -p ~/.ssh | ||
echo "${{ secrets.RENDER_KEY }}" > ~/.ssh/id_rsa | ||
chmod 600 ~/.ssh/id_rsa | ||
ssh-keyscan github.com >> ~/.ssh/known_hosts | ||
eval "$(ssh-agent -s)" | ||
ssh-add ~/.ssh/id_rsa | ||
- name: Set up R | ||
uses: r-lib/actions/setup-r@v2 | ||
|
@@ -35,20 +43,11 @@ jobs: | |
- name: Commit and Push Rendered Files | ||
run: | | ||
git config --local user.name "$GITHUB_ACTOR" | ||
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" | ||
git config user.name "github-actions[bot]" | ||
git config user.email "github-actions[bot]@users.noreply.github.com" | ||
git add . | ||
git commit -m "Render README.qmd files to gfm" || echo "No changes to commit" | ||
git fetch origin | ||
# Ensure the remote URL is SSH | ||
git remote set-url origin [email protected]:${GITHUB_REPOSITORY}.git | ||
# Set up SSH key for deployment key | ||
mkdir -p ~/.ssh | ||
echo "${{ secrets.RENDER_KEY }}" > ~/.ssh/id_rsa | ||
chmod 600 ~/.ssh/id_rsa | ||
ssh-keyscan github.com >> ~/.ssh/known_hosts | ||
# Push changes via SSH with deployment key | ||
git push origin main |