Skip to content

Daily Deploy

Daily Deploy #204

Workflow file for this run

name: Daily Deploy
on:
schedule:
- cron: '0 10 * * *'
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- name: Install dependencies
run: npm install
env:
CI: true
- name: Build shared package
run: npm run build-shared
- name: Generate sentiment report
run: npm --workspace backend run agent
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
REDDIT_CLIENT_ID: ${{ secrets.REDDIT_CLIENT_ID }}
REDDIT_CLIENT_SECRET: ${{ secrets.REDDIT_CLIENT_SECRET }}
REDDIT_USERNAME: ${{ secrets.REDDIT_USERNAME }}
REDDIT_PASSWORD: ${{ secrets.REDDIT_PASSWORD }}
REDDIT_URL: ${{ secrets.REDDIT_URL }}
- name: Generate static JSON
run: npm --workspace backend run generate-static
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
- name: Build frontend
run: npm --workspace frontend run predeploy
- name: Configure Git identity
run: |
git config --global user.email "github-actions@users.noreply.github.com"
git config --global user.name "github-actions"
- name: Authenticate with GitHub token
run: git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/clementvidon/devbarometer.git
- name: Deploy to GitHub Pages
run: npm --workspace frontend run deploy