Skip to content

Commit 6b5fc77

Browse files
authored
Merge branch 'main' into copilot/fix-407
2 parents 09e1de8 + dcf952a commit 6b5fc77

7 files changed

Lines changed: 174 additions & 34 deletions

File tree

.github/workflows/linkcheck.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,23 @@ jobs:
1111
permissions:
1212
issues: write # required for QuantEcon link-checker
1313
steps:
14-
# Checkout the live site (html)
15-
- name: Checkout
16-
uses: actions/checkout@v6
17-
with:
18-
ref: gh-pages
14+
# Download the latest release HTML archive (permanent, not subject to artifact expiry)
15+
- name: Get latest release asset URL
16+
id: release
17+
env:
18+
GH_TOKEN: ${{ github.token }}
19+
run: |
20+
ASSET_URL=$(gh api repos/${{ github.repository }}/releases/latest \
21+
--jq '.assets[] | select(.name | endswith(".tar.gz")) | .browser_download_url')
22+
echo "asset-url=$ASSET_URL" >> $GITHUB_OUTPUT
23+
- name: Download and extract release HTML
24+
run: |
25+
mkdir -p _site
26+
curl -sL "${{ steps.release.outputs.asset-url }}" | tar -xz -C _site
1927
- name: AI-Powered Link Checker
2028
uses: QuantEcon/action-link-checker@main
2129
with:
22-
html-path: '.' # gh-pages live html
30+
html-path: '_site'
2331
fail-on-broken: 'false'
2432
silent-codes: '403,503'
2533
ai-suggestions: 'true'

.github/workflows/publish.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,24 @@ on:
33
push:
44
tags:
55
- 'publish*'
6+
7+
permissions:
8+
contents: write
9+
actions: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
617
jobs:
718
publish:
819
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
920
runs-on: "runs-on=${{ github.run_id }}/family=g4dn.2xlarge/image=quantecon_ubuntu2404/disk=large"
21+
environment:
22+
name: github-pages
23+
url: ${{ steps.deployment.outputs.page_url }}
1024
steps:
1125
- name: Checkout
1226
uses: actions/checkout@v6
@@ -113,12 +127,17 @@ jobs:
113127
html-manifest.json
114128
env:
115129
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
116-
- name: Deploy website to gh-pages
117-
uses: peaceiris/actions-gh-pages@v4
130+
- name: Add CNAME for custom domain
131+
run: echo "python-programming.quantecon.org" > _build/html/CNAME
132+
- name: Setup Pages
133+
uses: actions/configure-pages@v5
134+
- name: Upload Pages artifact
135+
uses: actions/upload-pages-artifact@v3
118136
with:
119-
github_token: ${{ secrets.GITHUB_TOKEN }}
120-
publish_dir: _build/html/
121-
cname: python-programming.quantecon.org
137+
path: _build/html/
138+
- name: Deploy to GitHub Pages
139+
id: deployment
140+
uses: actions/deploy-pages@v4
122141
- name: Prepare lecture-python-programming.notebooks sync
123142
shell: bash -l {0}
124143
run: |

.github/workflows/sync-translations-fa.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Sync Translations — Farsi
22
# On merged PR, translate changed lectures into the Farsi target repo.
3+
# Comment \translate-resync on a merged PR to re-trigger sync.
34
name: Sync Translations (Farsi)
45

56
on:
@@ -8,18 +9,22 @@ on:
89
paths:
910
- 'lectures/**/*.md'
1011
- 'lectures/_toc.yml'
12+
issue_comment:
13+
types: [created]
1114

1215
jobs:
1316
sync:
14-
if: github.event.pull_request.merged == true
17+
if: >
18+
(github.event_name == 'pull_request' && github.event.pull_request.merged == true) ||
19+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '\translate-resync'))
1520
runs-on: ubuntu-latest
1621

1722
steps:
1823
- uses: actions/checkout@v6
1924
with:
2025
fetch-depth: 2
2126

22-
- uses: QuantEcon/action-translation@v0.11.1
27+
- uses: QuantEcon/action-translation@v0.13.0
2328
with:
2429
mode: sync
2530
target-repo: QuantEcon/lecture-python-programming.fa

.github/workflows/sync-translations-zh-cn.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Sync Translations — Simplified Chinese
22
# On merged PR, translate changed lectures into the zh-cn target repo.
3+
# Comment \translate-resync on a merged PR to re-trigger sync.
34
name: Sync Translations (Simplified Chinese)
45

56
on:
@@ -8,18 +9,22 @@ on:
89
paths:
910
- 'lectures/**/*.md'
1011
- 'lectures/_toc.yml'
12+
issue_comment:
13+
types: [created]
1114

1215
jobs:
1316
sync:
14-
if: github.event.pull_request.merged == true
17+
if: >
18+
(github.event_name == 'pull_request' && github.event.pull_request.merged == true) ||
19+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '\translate-resync'))
1520
runs-on: ubuntu-latest
1621

1722
steps:
1823
- uses: actions/checkout@v6
1924
with:
2025
fetch-depth: 2
2126

22-
- uses: QuantEcon/action-translation@v0.11.1
27+
- uses: QuantEcon/action-translation@v0.13.0
2328
with:
2429
mode: sync
2530
target-repo: QuantEcon/lecture-python-programming.zh-cn

lectures/_config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ sphinx:
2626
'https://data.oecd.org/',
2727
'https://www.reddit.com/',
2828
'https://openai.com',
29-
'https://chatgpt.com/']
29+
'https://chatgpt.com/',
30+
'https://fred.stlouisfed.org/.*']
3031
nb_merge_streams: true
3132
# sphinx-exercise
3233
exercise_style: "solution_follow_exercise"

lectures/pandas.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ The dataset contains the following indicators
169169
We'll read this in from a URL using the `pandas` function `read_csv`.
170170

171171
```{code-cell} ipython3
172-
df = pd.read_csv('https://raw.githubusercontent.com/QuantEcon/lecture-python-programming/master/source/_static/lecture_specific/pandas/data/test_pwt.csv')
172+
df = pd.read_csv('https://raw.githubusercontent.com/QuantEcon/lecture-python-programming/main/lectures/_static/lecture_specific/pandas/data/test_pwt.csv')
173173
type(df)
174174
```
175175

0 commit comments

Comments
 (0)