Skip to content

Commit c3b779e

Browse files
authored
Merge branch 'devel' into dockefile/misc
2 parents 625adac + 69fd2a5 commit c3b779e

File tree

2 files changed

+40
-15
lines changed

2 files changed

+40
-15
lines changed

.github/workflows/build-mkdocs-website.yml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,39 @@ jobs:
3131
- name: Install dependencies
3232
run: pip install mkdocs mkdocs-material[imaging]
3333

34-
- name: Determine deployment path
35-
id: path
34+
- name: Determine deployment settings
35+
id: config
3636
run: |
3737
if [[ "${{ github.ref_name }}" == "main" ]]; then
38+
echo "target_repo=${{ github.repository }}" >> "$GITHUB_OUTPUT"
3839
echo "url=https://contributor.r-project.org/r-dev-env" >> "$GITHUB_OUTPUT"
3940
else
40-
echo "url=https://contributor.r-project.org/r-dev-env/devel" >> "$GITHUB_OUTPUT"
41+
echo "target_repo=r-devel/r-dev-env-devel" >> "$GITHUB_OUTPUT"
42+
echo "url=https://contributor.r-project.org/r-dev-env-devel" >> "$GITHUB_OUTPUT"
4143
fi
4244
4345
- name: Modify site_url in mkdocs.yml
4446
run: |
45-
echo "Setting site_url to ${{ steps.path.outputs.url }}"
46-
sed -i "s|^site_url:.*|site_url: '${{ steps.path.outputs.url }}'|" mkdocs.yml
47-
47+
echo "Setting site_url to ${{ steps.config.outputs.url }}"
48+
sed -i "s|^site_url:.*|site_url: '${{ steps.config.outputs.url }}'|" mkdocs.yml
4849
4950
- name: Build MkDocs
5051
run: mkdocs build
5152

53+
- name: Validate PAT
54+
env:
55+
GH_PAT: ${{ secrets.R_DEV_ENV_DOCS }}
56+
run: |
57+
curl -H "Authorization: token $GH_PAT" https://api.github.com/user || {
58+
echo "PAT is invalid or expired" >&2
59+
exit 1
60+
}
61+
5262
- name: Deploy to GitHub Pages
5363
env:
54-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
GH_PAT: ${{ secrets.R_DEV_ENV_DOCS }}
5565
run: |
56-
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}
57-
mkdocs gh-deploy --force
58-
git push origin gh-pages
66+
echo "Deploying from branch: ${{ github.ref_name }}"
67+
echo "Commit: ${{ github.sha }}"
68+
git remote set-url origin https://x-access-token:${GH_PAT}@github.com/${{ steps.config.outputs.target_repo }}
69+
mkdocs gh-deploy --config-file mkdocs.yml --remote-branch gh-pages --force

docs/tutorials/running_r.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
1) Create a file in VS Code ending with a .R extension. You can create new files
2+
1) Create a file in VS Code ending with a `.R` extension. You can create new files
33
by clicking on the new file icon in VS Code Explorer, or use the `code` command
44
in the terminal to create and open an R file
55

@@ -10,11 +10,25 @@ code R/test.R
1010
![alt text](../assets/rdev4.png)
1111

1212
2) You should see `R:(not attached)` in the Status Bar at the bottom of the
13-
VSCode window.
13+
VSCode window:
1414

1515
![alt text](../assets/rdev11.png)
1616

17-
3) Click on the `R:(not attached)` link to launch an R terminal. You can then
18-
send code from the `.R` file to the R terminal by pressing `cmd/ctrl + enter`.
17+
Click on the `R:(not attached)` link to launch an R terminal.
1918

20-
![alt text](../assets/rdev12.png) ![alt text](../assets/rdev5.png)
19+
![alt text](../assets/rdev12.png)
20+
21+
<!-- markdownlint-disable MD046 -->
22+
!!! Note
23+
If you don't see the `R:(not attached)` link in the status
24+
bar, you can open an R terminal using the VS Code Command Palette. Click the
25+
cog icon ('Manage') in the bottom left of the VS Code window, then click
26+
`Command Palette` (note the keyboard shortcut displayed next to this menu
27+
item for future use). This starts a prompt at the top of the VS Code window.
28+
Type `R terminal` and select the command `R: Create R terminal`.
29+
<!-- markdownlint-enable MD046 -->
30+
31+
3) You can then send code from the `.R` file to the R terminal by pressing
32+
`cmd/ctrl + enter`.
33+
34+
![alt text](../assets/rdev5.png)

0 commit comments

Comments
 (0)