Skip to content

Remove duplicate Draft promo card from homepage #502

Remove duplicate Draft promo card from homepage

Remove duplicate Draft promo card from homepage #502

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
run: |
sudo apt-get install -y lftp > /dev/null 2>&1
lftp -e "
set ssl:verify-certificate false;
set ftp:ssl-force true;
open -u ${{ secrets.FTP_USERNAME }},${{ secrets.FTP_PASSWORD }} ${{ secrets.FTP_SERVER }};
mirror --reverse --delete --verbose ./dist/ ${REMOTE_DEPLOY_PATH};
quit;
"
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
rg -q 'Yard Report' /tmp/yardreport-home.html
rg -q 'id="scoresTrack"' /tmp/yardreport-home.html
rg -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
rg -q '"feedTitle"' /tmp/yardreport-proxy.json
rg -q '"items"' /tmp/yardreport-proxy.json