switching to a github workflow #1
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
name: Build and deploy app | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Upgrade pip and install packages | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install uv | |
uv venv | |
source .venv/bin/activate | |
uv pip install -r requirements.txt | |
# ===================================================== | |
# Build | |
# ===================================================== | |
- uses: quarto-dev/quarto-actions/setup@v2 | |
with: | |
version: pre-release | |
- name: Build page with Quarto | |
run: | | |
source .venv/bin/activate | |
quarto render --output-dir _build | |
- name: Create shinylive site | |
run: | | |
source .venv/bin/activate | |
shinylive export _build _site | |
# ===================================================== | |
# Upload _site/ artifact | |
# ===================================================== | |
- name: Upload _site/ artifact | |
if: github.ref == 'refs/heads/main' | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: "_site/" | |
# ===================================================== | |
# Deploy GitHub Pages site | |
# ===================================================== | |
deploy_gh_pages: | |
if: github.ref == 'refs/heads/main' | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
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@v2 |