Skip to content

Commit 098d795

Browse files
committed
download data in workflow
1 parent 6d829d1 commit 098d795

2 files changed

Lines changed: 27 additions & 8 deletions

File tree

.github/workflows/publish.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ jobs:
1717
- name: Set up Quarto
1818
uses: quarto-dev/quarto-actions/setup@v2
1919

20-
2120
- name: "Set up Python"
2221
uses: actions/setup-python@v5
2322
with:
@@ -31,6 +30,15 @@ jobs:
3130

3231
- name: Install the project
3332
run: uv sync --locked --all-extras --dev
33+
34+
- name: Install curl
35+
run: |
36+
sudo apt-get update
37+
sudo apt-get install -y curl jq unzip
38+
39+
- name: Download data
40+
run: |
41+
sh data/downloadLabourData.sh
3442
3543
- name: Render and Publish
3644
uses: quarto-dev/quarto-actions/publish@v2

data/downloadLabourData.sh

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
1-
# download unadjusted
2-
cd data
1+
#!/bin/bash
2+
3+
# Set target directory (modify this path as needed)
4+
TARGET_DIR=data/
5+
6+
# Create target directory if it doesn't exist
7+
mkdir -p "$TARGET_DIR"
38

4-
URL=$(curl -s 'https://www150.statcan.gc.ca/t1/wds/rest/getFullTableDownloadCSV/14100022/en' | grep -o 'https://[^"]*')
5-
curl -o 14100022-eng.zip "$URL"
6-
unzip 14100022-eng.zip
7-
rm 14100022-eng.zip
9+
# Change to target directory
10+
cd "$TARGET_DIR"
11+
12+
# download unadjusted
13+
# URL=$(curl -s 'https://www150.statcan.gc.ca/t1/wds/rest/getFullTableDownloadCSV/14100022/en' | grep -o 'https://[^"]*')
14+
# curl -o 14100022-eng.zip "$URL"
15+
# unzip 14100022-eng.zip
16+
# rm 14100022-eng.zip
817

918
# download seasonally adjusted
19+
echo "Downloading to: $(pwd)"
1020
URL=$(curl -s 'https://www150.statcan.gc.ca/t1/wds/rest/getFullTableDownloadCSV/14100355/en' | jq -r '.object')
1121
curl -o 14100355-eng.zip "$URL"
1222
unzip 14100355-eng.zip
13-
rm 14100355-eng.zip
23+
rm 14100355-eng.zip
24+
echo "Download completed in: $TARGET_DIR"

0 commit comments

Comments
 (0)