Skip to content

Add "Top Prospects Remaining" board to the Draft page and rearrange f… #519

Add "Top Prospects Remaining" board to the Draft page and rearrange f…

Add "Top Prospects Remaining" board to the Draft page and rearrange f… #519

Workflow file for this run

name: Build and Deploy
on:
push:
branches: [main]
schedule:
- cron: '17 11 * * *'
- cron: '47 11 * * *'
workflow_dispatch:
env:
REMOTE_DEPLOY_PATH: ./public_html/yardreport/
SITE_URL: https://www.briancsmith.org/yardreport/
HEALTH_FEED_URL: https://www.mlb.com/orioles/feeds/news/rss.xml
jobs:
deploy:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run smoke
- name: Deploy via lftp
env:
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
FTP_SERVER: ${{ secrets.FTP_SERVER }}
run: |
sudo apt-get install -y lftp > /dev/null 2>&1
lftp <<LFTP_EOF
set ssl:verify-certificate false
set ftp:ssl-force true
open "$FTP_SERVER"
user "$FTP_USERNAME" "$FTP_PASSWORD"
mirror --reverse --delete --verbose ./dist/ ${REMOTE_DEPLOY_PATH}
quit
LFTP_EOF
smoke_and_homepage_check:
if: github.event_name == 'schedule' && github.event.schedule == '17 11 * * *'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run smoke
- name: Check live homepage
run: |
curl -fsSL "${SITE_URL}" | tee /tmp/yardreport-home.html > /dev/null
grep -q 'Yard Report' /tmp/yardreport-home.html
grep -q 'id="scoresTrack"' /tmp/yardreport-home.html
grep -q 'id="articleList"' /tmp/yardreport-home.html
proxy_and_feed_check:
if: github.event_name == 'schedule' && github.event.schedule == '47 11 * * *'
runs-on: ubuntu-latest
steps:
- name: Check production RSS proxy
run: |
ENCODED_FEED_URL="$(python3 -c "import urllib.parse; print(urllib.parse.quote('${HEALTH_FEED_URL}', safe=''))")"
PROXY_URL="${SITE_URL}rss-proxy.php?url=${ENCODED_FEED_URL}"
curl -fsSL "${PROXY_URL}" | tee /tmp/yardreport-proxy.json > /dev/null
grep -q '"feedTitle"' /tmp/yardreport-proxy.json
grep -q '"items"' /tmp/yardreport-proxy.json