| 1 |
name: Generate dpp.dev sitemap |
| 2 |
on: |
| 3 |
schedule: |
| 4 |
- cron: '0 6 * * 6' |
| 5 |
|
| 6 |
permissions: |
| 7 |
contents: read |
| 8 |
|
| 9 |
jobs: |
| 10 |
updater: |
| 11 |
permissions: |
| 12 |
contents: write |
| 13 |
name: Generate Sitemap |
| 14 |
if: github.repository == 'brainboxdotcc/DPP' |
| 15 |
runs-on: ubuntu-24.04 |
| 16 |
|
| 17 |
env: |
| 18 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 19 |
|
| 20 |
steps: |
| 21 |
- name: Harden Runner |
| 22 |
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 |
| 23 |
with: |
| 24 |
egress-policy: audit |
| 25 |
|
| 26 |
- name: Checkout github pages repository |
| 27 |
run: git config --global user.email "[email protected]" && git config --global user.name "D++ Sitemap Updater Bot" && git clone https://braindigitalis:[email protected]/brainboxdotcc/dpp-web.git /home/runner/dpp-web |
| 28 |
env: |
| 29 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 30 |
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} |
| 31 |
|
| 32 |
- name: Install sitemap-generator |
| 33 |
run: npm install [email protected] --save-exact |
| 34 |
|
| 35 |
- name: Run sitemap-generator |
| 36 |
run: cd /home/runner/dpp-web && npx sitemap-generator --no-respect-robots-txt --verbose https://dpp.dev/ |
| 37 |
|
| 38 |
- name: commit and push |
| 39 |
run: cd /home/runner/dpp-web && git add sitemap.xml && git commit -am "Update sitemap" && git pull --ff && git push |
| 40 |
env: |
| 41 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 42 |
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} |
| 43 |
|
| 44 |
|