update: refresh exploratory data analysis workshop materials (#1) #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: Deploy slides to GitHub Pages | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "config/**" | |
| - "workshops/**" | |
| - "assets/**" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| QUARTO_CACHE_DIR: ${{ github.workspace }}/.quarto-cache | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Cache Quarto cache and libs | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .quarto-cache | |
| ~/.cache/quarto | |
| key: ${{ runner.os }}-quarto-${{ hashFiles('config/_quarto.yml', 'config/slides/index.qmd', 'workshops/fundamentals/index.qmd', 'workshops/loops-and-functions/index.qmd', 'workshops/exploratory-data-analysis/index.qmd', 'config/slides/theme/**') }} | |
| restore-keys: | | |
| ${{ runner.os }}-quarto- | |
| - name: Setup Quarto | |
| uses: quarto-dev/quarto-actions/setup@v2 | |
| with: | |
| version: 1.6.40 | |
| - name: Render slides | |
| run: | | |
| cd config | |
| quarto render slides/index.qmd | |
| quarto render ../workshops/fundamentals/index.qmd --to revealjs | |
| quarto render ../workshops/loops-and-functions/index.qmd --to revealjs | |
| quarto render ../workshops/exploratory-data-analysis/index.qmd --to revealjs | |
| - name: Assemble Pages site | |
| run: | | |
| rm -rf site | |
| mkdir -p site | |
| cp config/slides/index.html site/index.html | |
| rsync -av config/slides/index_files/ site/index_files/ 2>/dev/null || true | |
| rsync -av assets/ site/assets/ | |
| rsync -av workshops/fundamentals/ site/fundamentals/ --exclude "*.ipynb" --exclude "*.qmd" | |
| rsync -av workshops/loops-and-functions/ site/loops-and-functions/ --exclude "*.ipynb" --exclude "*.qmd" | |
| rsync -av workshops/exploratory-data-analysis/ site/exploratory-data-analysis/ --exclude "*.ipynb" --exclude "*.qmd" | |
| # Landing page: fix logo path (../../assets/ -> assets/) | |
| sed -i.bak 's|../../assets/|assets/|g' site/index.html && rm -f site/index.html.bak | |
| # Workshop pages: fix asset paths (../../assets/ -> ../assets/) so they load from site/fundamentals/ etc. | |
| sed -i.bak 's|../../assets/|../assets/|g' site/fundamentals/index.html site/loops-and-functions/index.html site/exploratory-data-analysis/index.html 2>/dev/null || true | |
| rm -f site/fundamentals/index.html.bak site/loops-and-functions/index.html.bak site/exploratory-data-analysis/index.html.bak 2>/dev/null || true | |
| - name: Upload Pages artifact (site root) | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: site | |
| deploy: | |
| needs: build | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |