-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yong Sheng Tan
committed
Feb 10, 2024
1 parent
8e16fcd
commit 4432028
Showing
47 changed files
with
1,324,664 additions
and
1,324,666 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,35 @@ | ||
name: Sync to Hugging Face hub | ||
on: | ||
push: | ||
branches: [main] | ||
|
||
# to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
sync-to-hub: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
lfs: true | ||
|
||
- name: Push to hub | ||
env: | ||
HF_TOKEN: ${{ secrets.HF_TOKEN }} | ||
run: git push https://HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/tan-yong-sheng/gh-actions-scraping-MY-houses main | ||
name: Sync to Hugging Face hub | ||
on: | ||
push: | ||
branches: [main] | ||
|
||
# to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
sync-to-hub: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
lfs: true | ||
|
||
- name: Add index.md | ||
run: | | ||
echo | ||
"""--- | ||
title: Scraping Malaysia Housing data | ||
emoji: 🏃 | ||
colorFrom: pink | ||
colorTo: gray | ||
sdk: docker | ||
pinned: false | ||
license: mit | ||
--- | ||
""" > index.md | ||
- name: Push to hub | ||
env: | ||
HF_TOKEN: ${{ secrets.HF_TOKEN }} | ||
run: git push https://HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/tan-yong-sheng/gh-actions-scraping-MY-houses main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
# Limit every single file with size under 10MB so that it could be sync to HuggingFace | ||
# Reference: https://huggingface.co/docs/hub/spaces-github-actions | ||
|
||
name: Check file size | ||
on: # or directly `on: [push]` to run the action on every push on any branch | ||
pull_request: | ||
branches: [main] | ||
|
||
# to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
sync-to-hub: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check large files | ||
uses: ActionsDesk/lfs-warning@v2.0 | ||
with: | ||
# Limit every single file with size under 10MB so that it could be sync to HuggingFace | ||
# Reference: https://huggingface.co/docs/hub/spaces-github-actions | ||
|
||
name: Check file size | ||
on: # or directly `on: [push]` to run the action on every push on any branch | ||
pull_request: | ||
branches: [main] | ||
|
||
# to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
sync-to-hub: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check large files | ||
uses: ActionsDesk/lfs-warning@v2.0 | ||
with: | ||
filesizelimit: 10485760 # this is 10MB so we can sync to HF Spaces |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
|
||
name: Create PDF report from Jupyter Notebook | ||
|
||
on: | ||
schedule: | ||
- cron: "0 4 * * *" | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
# Assigning permissions to jobs # https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs | ||
# Modify the default permissions granted to GITHUB_TOKEN. | ||
permissions: write-all | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.9" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install ipython ipykernel nbconvert nbclient playwright pyppeteer | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: executing jupyter notebook & export PDF report | ||
run: | | ||
git fetch && git merge # sycn between this repo and docker instance created by this script | ||
current_datetime=$(date +'%Y-%m-%dt%H:%M:%S') | ||
converted_date=$(TZ=Asia/Kuala_Lumpur date -d "$current_datetime" +'%Y-%m-%d') | ||
jupyter execute notebook/housing_data.ipynb | ||
jupyter nbconvert --output-dir='./report' --output report_$converted_date --to webpdf --allow-chromium-download notebook/housing_data.ipynb | ||
- name: Commit the changes to this github repo | ||
uses: mikeal/publish-to-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub sets this for you | ||
BRANCH_NAME: 'main' | ||
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
|
||
name: Create PDF report from Jupyter Notebook | ||
|
||
on: | ||
schedule: | ||
- cron: "0 4 * * *" | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
# Assigning permissions to jobs # https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs | ||
# Modify the default permissions granted to GITHUB_TOKEN. | ||
permissions: write-all | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.9" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install ipython ipykernel nbconvert nbclient playwright pyppeteer | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: executing jupyter notebook & export PDF report | ||
run: | | ||
git fetch && git merge # sycn between this repo and docker instance created by this script | ||
current_datetime=$(date +'%Y-%m-%dt%H:%M:%S') | ||
converted_date=$(TZ=Asia/Kuala_Lumpur date -d "$current_datetime" +'%Y-%m-%d') | ||
jupyter execute notebook/housing_data.ipynb | ||
jupyter nbconvert --output-dir='./report' --output report_$converted_date --to webpdf --allow-chromium-download notebook/housing_data.ipynb | ||
- name: Commit the changes to this github repo | ||
uses: mikeal/publish-to-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub sets this for you | ||
BRANCH_NAME: 'main' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,57 @@ | ||
name: documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.9" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
sudo apt install pandoc | ||
pip install sphinx furo myst_parser nbsphinx sphinx-autoapi | ||
pip install flake8 pytest | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Lint with flake8 | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Test with pytest | ||
run: | | ||
pytest | ||
- name: Sphinx build | ||
run: | | ||
sphinx-build docs docs/_build | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
with: | ||
publish_branch: gh-pages | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: docs/_build/ | ||
force_orphan: true | ||
name: documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.9" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
sudo apt install pandoc | ||
pip install sphinx furo myst_parser nbsphinx sphinx-autoapi | ||
pip install flake8 pytest | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Lint with flake8 | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Test with pytest | ||
run: | | ||
pytest | ||
- name: Sphinx build | ||
run: | | ||
sphinx-build docs docs/_build | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
with: | ||
publish_branch: gh-pages | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: docs/_build/ | ||
force_orphan: true |
Oops, something went wrong.