Skip to content

Render Quarto doc #1827

Render Quarto doc

Render Quarto doc #1827

Workflow file for this run

on:
push:
branches: [main, master]
schedule:
- cron: '5 12-15 * * 1-5'
repository_dispatch:
types: [quarto_update]
workflow_dispatch:
name: Render Quarto doc
jobs:
Render:
runs-on: ubuntu-22.04
env:
LANG: "pt_BR.UTF-8"
steps:
- name: Checkout this repo
uses: actions/checkout@v3
- name: Checkout private repo
uses: actions/checkout@v3
with:
repository: schoulten/macro_report_priv
path: "./report"
token: ${{ secrets.PAT }}
- name: Set locale
run: |
sudo locale-gen pt_BR.UTF-8
sudo update-locale LANG=pt_BR.UTF-8
- name: Install R
uses: r-lib/actions/setup-r@v2
with:
r-version: '4.4.0'
use-public-rspm: true
- name: Install R packages
uses: r-lib/actions/setup-renv@v2
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.1
- name: Install Python packages
run: poetry install --no-root
- name: Python code
run: |
poetry config virtualenvs.prefer-active-python true
poetry run python Python/etl.py
- name: Setup Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Render Quarto doc
run: |
cp -r report/* ./
quarto render index.qmd
rm -rf report contents resources index.qmd macro_report_priv.Rproj
mv index.html docs
- name: Create PDF doc
run: |
pagedown::chrome_print(input = "docs/index.html", format = "pdf", options = list(paperWidth = 11, paperHeight = 11))
shell: Rscript {0}
- name: Commit & Push
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Data ETL and report update