include G-analytics #37
This file contains hidden or 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
name: Quarto Publish | |
on: | |
workflow_dispatch: | |
push: | |
branches: main | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
env: | |
CAT_API_KEY: ${{ secrets.CAT_API_KEY }} | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Quarto | |
uses: quarto-dev/quarto-actions/setup@v2 | |
with: | |
version: pre-release | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Fetch Cat Images | |
run: | | |
mkdir -p _data | |
node .github/scripts/fetch-cats.js | |
echo "Checking if cats.json exists:" | |
ls -l _data/ | |
echo "Contents of cats.json:" | |
cat _data/cats.json | |
env: | |
CAT_API_KEY: ${{ secrets.CAT_API_KEY }} | |
- name: Render Quarto Project | |
run: | | |
echo "Contents of _data before render:" | |
ls -l _data/ | |
quarto render | |
echo "Contents of _site after render:" | |
ls -l _site/ | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./_site |