-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (84 loc) · 3.05 KB
/
build-readme.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
schedule:
# At 00:00 on Sunday
- cron: "*/15 * * * *"
pull_request:
branches: [main, master]
jobs:
build-readme:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
- name: Debugging - List Files
run: |
# List the files in the current directory
ls -R profile/
- name: Build Readme
run: Rscript -e 'rmarkdown::render("profile/README.Rmd", output_format = "md_document", output_file = "new_readme.md", output_dir = "profile")'
- name: Debugging - List Files After Rendering
run: |
# List the files after rendering
ls -R profile/
# - name: Commit files
# run: |
# git config --global user.email "[email protected]"
# git config --global user.name "david-nemirovsky"
# git add --all
# git commit -am "chronjob"
# git push origin HEAD:refs/heads/master --force
- name: Commit and push changes
run: |
git config --global user.email "[email protected]"
git config --global user.name "david-nemirovsky"
git add --all
git commit -m "Update README.md"
git push origin ${{ github.ref }}
- name: Debugging - List Files After Commit
run: |
# List the files after committing
ls -R profile/
# - name: Check File Existence
# run: |
# if [ -f profile/new_readme.md ]; then
# echo "File exists, proceed with renaming."
# else
# echo "File does not exist, check the rendering step."
# exit 1
# fi
- name: Rename new_readme.md to README.md
run: mv profile/new_readme.md profile/README.md
# jobs:
# build-readme:
# runs-on: ubuntu-latest
# env:
# GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# steps:
# - uses: actions/checkout@v2
# - uses: r-lib/actions/setup-pandoc@v2
# - uses: r-lib/actions/setup-r@v2
# with:
# use-public-rspm: true
#
# - uses: r-lib/actions/setup-r-dependencies@v2
#
# - name: Build Readme
# run: Rscript -e 'rmarkdown::render("profile/README.Rmd", output_format = "md_document", output_file = "profile/new_readme.md")'
# - name: Commit files
# run: |
# git config --global user.email "[email protected]"
# git config --global user.name "GitHub Actions User"
# git add --all
# git commit -am "chronjob"
# git push origin HEAD:refs/heads/master --force
#
# - name: Rename new_readme.md to README.md
# run: mv new_readme.md README.md