Skip to content

devices: sweet april update #38

devices: sweet april update

devices: sweet april update #38

Workflow file for this run

name: CI
on:
push:
branches:
- "ursa"
paths:
- "devices/**"
- "devices.json"
- "team.json"
jobs:
notify:
name: Notify Release
runs-on: ubuntu-latest
env:
BOT_API: ${{ secrets.BOT_API }}
CHANNEL_ID: ${{ secrets.CHANNEL_ID }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 5
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Notify
run: |
node .github/notify.js
revalidate:
runs-on: ubuntu-latest
needs: [notify]
env:
SECRET: ${{ secrets.SECRET }}
name: Revalidate paths
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 5
- name: Revalidate paths
run: |
site_url='https://awakenos.vercel.app'
mapfile -t changed_files < <(git diff --name-only HEAD~1)
if [[ -n $(echo "${changed_files[@]}" | grep -i "devices.json") ]]; then
# revalidate downloads page
echo "Revalidating downloads page...\n"
curl -s "${site_url}/api/revalidate?path=/downloads&secret=${SECRET}"
curl -s "${site_url}/downloads" &> /dev/null
fi
if [[ -n $(echo "${changed_files[@]}" | grep -i "team.json") ]]; then
# revalidate team page
echo "Revalidating team page...\n"
curl -s "${site_url}/api/revalidate?path=/team&secret=${SECRET}"
curl -s "${site_url}/team" &> /dev/null
fi