Deploy to Cloudflare Pages #2750
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: Deploy to Cloudflare Pages | |
on: | |
schedule: | |
- cron: '0 * * * *' | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Create and activate virtual environment | |
run: | | |
python -m venv venv | |
source venv/bin/activate | |
- name: Install Python dependencies | |
run: | | |
pip install --upgrade pip | |
pip install duckdb==1.1.0 | |
# Add any other required Python packages here | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install Observable Framework | |
run: npm install @observablehq/framework | |
- name: Build Observable Framework site | |
run: npm run build | |
env: | |
MOTHERDUCK_TOKEN: ${{ secrets.MOTHERDUCK_TOKEN }} | |
- name: Deploy to Cloudflare Workers with Wrangler | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
command: | | |
pages deploy ./dist --project-name="data-adj-news" --branch="" |