Skip to content

Commit a17140f

Browse files
committed
fix: delete blog text from pkgdown
1 parent eb465f3 commit a17140f

File tree

1 file changed

+22
-62
lines changed

1 file changed

+22
-62
lines changed

.github/workflows/pkgdown.yaml

Lines changed: 22 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
1616
env:
1717
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
18+
BLOG_REPO: DiogoRibeiro7/DiogoRibeiro7.github.io
19+
BLOG_DEST: packages/myrpackage
1820
permissions:
1921
contents: write
2022
steps:
@@ -28,79 +30,36 @@ jobs:
2830

2931
- uses: r-lib/actions/setup-r-dependencies@v2
3032
with:
31-
extra-packages: any::pkgdown, local::.
33+
extra-packages: |
34+
any::roxygen2
35+
any::pkgdown
36+
local::.
3237
needs: website
3338

39+
- name: Document (generate NAMESPACE & man/)
40+
run: roxygen2::roxygenise()
41+
shell: Rscript {0}
42+
43+
# You can use build_site_github_pages(); build_site() is fine since we copy to blog
3444
- name: Build site
35-
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
45+
run: pkgdown::build_site(preview = FALSE)
3646
shell: Rscript {0}
3747

3848
- name: Checkout blog repository
3949
uses: actions/checkout@v4
4050
with:
41-
repository: DiogoRibeiro7/DiogoRibeiro7.github.io
42-
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
51+
repository: ${{ env.BLOG_REPO }}
52+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} # PAT with repo write access to the blog repo
4353
path: blog-repo
4454

45-
- name: Copy package docs to blog
55+
- name: Copy package docs to blog (includes dotfiles, cleans removed files)
4656
run: |
47-
# Create the packages directory in blog if it doesn't exist
48-
mkdir -p blog-repo/packages/myrpackage
49-
50-
# Copy the built documentation
51-
cp -r docs/* blog-repo/packages/myrpackage/
52-
53-
# Update navigation and create index page
54-
cd blog-repo
55-
56-
- name: Create package index page
57-
run: |
58-
cat > blog-repo/packages/index.md << 'EOF'
59-
---
60-
layout: single
61-
title: "R Packages"
62-
permalink: /packages/
63-
author_profile: true
64-
header:
65-
image: /assets/images/data_science_1.jpg
66-
overlay_image: /assets/images/data_science_1.jpg
67-
teaser: /assets/images/data_science_1.jpg
68-
show_overlay_excerpt: false
69-
twitter_image: /assets/images/data_science_1.jpg
70-
og_image: /assets/images/data_science_1.jpg
71-
seo_type: article
72-
---
73-
74-
# R Packages
75-
76-
This section contains documentation for R packages I've developed.
57+
mkdir -p "blog-repo/${BLOG_DEST}"
58+
rsync -av --delete docs/ "blog-repo/${BLOG_DEST}/"
59+
# short listing for debugging
60+
ls -la "blog-repo/${BLOG_DEST}" | sed -n '1,80p'
7761
78-
## Available Packages
79-
80-
### [myrpackage](/packages/myrpackage/)
81-
82-
A multilingual greeting and farewell package that demonstrates proper R package structure, documentation, and testing practices. It provides functions for greeting and saying farewell in multiple languages including English, Spanish, French, Portuguese, German, and Italian.
83-
84-
**Features:**
85-
- Multilingual greetings and farewells
86-
- Comprehensive documentation and examples
87-
- Full test coverage
88-
- Proper R package structure
89-
- CI/CD pipeline with GitHub Actions
90-
91-
[View Documentation →](/packages/myrpackage/)
92-
EOF
93-
94-
- name: Update main navigation
95-
run: |
96-
# Create navigation entry for packages if it doesn't exist
97-
if ! grep -q "packages" blog-repo/_data/navigation.yml; then
98-
cat >> blog-repo/_data/navigation.yml << 'EOF'
99-
100-
- title: "Packages"
101-
url: /packages/
102-
EOF
103-
fi
62+
# No index/nav editing here since your blog already has the page and navigation.
10463

10564
- name: Commit and push changes
10665
run: |
@@ -111,6 +70,7 @@ jobs:
11170
if git diff --staged --quiet; then
11271
echo "No changes to commit"
11372
else
114-
git commit -m "Update myrpackage documentation"
73+
git commit -m "Update unconfoundedr documentation"
11574
git push
11675
fi
76+

0 commit comments

Comments
 (0)