-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (52 loc) · 1.54 KB
/
update_repository.yml
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
name: Update Python Package Repository Index
on:
schedule:
- cron: '30 23 * * *' # Runs at midnight every day; adjust as necessary
release:
types: [created, edited, published]
push:
branches:
- main
workflow_dispatch:
jobs:
update-package-index:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install typer PyGithub
- name: Generate Repository Index on Main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python ./workspace/generate_package_index.py ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} bpy
- name: Move docs up one level
run: |
mv docs ..
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
- name: Replace docs with generated docs
run: |
rm -rf ./docs
mv ../docs .
- name: Commit and Push to gh-pages
uses: EndBug/add-and-commit@v7
with:
author_name: GitHub Actions
author_email: github-actions[bot]@users.noreply.github.com
message: 'Update package index'
add: './docs'
branch: 'gh-pages'
token: ${{ secrets.GITHUB_TOKEN }}