Refresh investments data and re-deploy on daily basis #1430
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: Refresh investments data and re-deploy on daily basis | |
env: | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
on: | |
push: | |
branches: | |
- master | |
schedule: | |
- cron: '0 17 * * *' | |
workflow_dispatch: | |
jobs: | |
refresh: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Connect to repository | |
uses: actions/checkout@v4 | |
- name: Setup PNPM | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Setup NodeJS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
cache: 'pnpm' | |
- name: Install all required dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Installing Chromium via Puppeteer | |
run: node ./node_modules/puppeteer/install.mjs | |
- name: Build the files | |
run: pnpm run scrap:build | |
- name: Scrap and renew the data | |
run: pnpm run scrap | |
- name: Recommit the data | |
run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git add . | |
git commit --allow-empty -m "chore(ci): Refresh investments data" | |
git push | |
- name: Install Vercel CLI | |
run: npm install -g vercel@latest | |
- name: Pull Vercel Environment Information | |
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Build Project Artifacts | |
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Deploy Project Artifacts to Vercel | |
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} |