-
Notifications
You must be signed in to change notification settings - Fork 5
83 lines (83 loc) · 3.36 KB
/
update.yml
File metadata and controls
83 lines (83 loc) · 3.36 KB
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
on:
schedule:
- cron: '17 * * * *'
push:
branches:
- 'main'
pull_request:
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/setup-python@v6
with:
python-version: "3.x"
- uses: astral-sh/setup-uv@v7
- uses: actions/checkout@v5
- run: sudo apt-get install -y gettext
- run: pip install -r requirements.txt
- run: uv run generate.py # generates index.html and index.json
- run: uv run generate_related_projects.py # generates related.html
- name: Deploy 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build
clean: false
git-config-name: github-actions[bot]
git-config-email: 41898282+github-actions[bot]@users.noreply.github.com
- name: Deploy to subdirectory if pull request 🚀
# This does not work for PRs from forks
if: github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build
target-folder: ${{ github.ref_name }}
clean: false
git-config-name: github-actions[bot]
git-config-email: 41898282+github-actions[bot]@users.noreply.github.com
- name: Update PR description if pull request
# This does not work for PRs from forks
if: github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork
uses: chabroA/action-append-pr-description@v1.2.1
with:
auth: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ github.event.repository.name }}
owner: ${{ github.repository_owner }}
pr: ${{ github.event.number }}
url: "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/${{ github.ref_name }}/"
message: "📊 Dashboard preview 📊:"
- name: Debug index.html if pull request
if: github.event_name == 'pull_request'
run: |
curl -Lo index.html-public https://github.com/python-docs-translations/dashboard/raw/refs/heads/gh-pages/index.html
diff --color=always -u index.html-public build/index.html || :
cat build/index.html
- run: uv run generate_build_details.py # generates build-details.html
- name: Deploy build details view 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build
clean: false
git-config-name: github-actions[bot]
git-config-email: 41898282+github-actions[bot]@users.noreply.github.com
- name: Deploy metadata view to subdirectory if pull request 🚀
# This does not work for PRs from forks
if: github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build
target-folder: ${{ github.ref_name }}
clean: false
git-config-name: github-actions[bot]
git-config-email: 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/upload-artifact@v5
if: always()
with:
name: build
path: build