Skip to content

status-update

status-update #138

Workflow file for this run

name: Deploy Docs
on:
push:
branches: [main]
schedule:
- cron: "0 */6 * * *" # Every 6 hours
workflow_dispatch:
repository_dispatch:
types: [status-update]
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
path: daemonless-io
- uses: actions/checkout@v6
with:
repository: daemonless/daemonless
token: ${{ secrets.DISPATCH_TOKEN }}
path: daemonless
- uses: actions/checkout@v6
with:
repository: daemonless/dbuild
path: dbuild
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install dependencies
run: |
cd daemonless-io
pip install -r requirements.txt
- name: Fetch repositories
env:
GH_TOKEN: ${{ github.token }}
run: |
cd daemonless-io
make fetch
- name: Generate documentation
env:
GH_TOKEN: ${{ github.token }}
run: |
cd daemonless-io
make generate
- name: Commit generated changes
env:
GH_TOKEN: ${{ secrets.DISPATCH_TOKEN }}
run: |
# Commit to daemonless-io
cd daemonless-io
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add mkdocs.yaml
git diff --staged --quiet || git commit -m "Update generated docs and status [skip ci]"
git push
# Commit to daemonless/daemonless (Org README)
cd ../daemonless
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add README.md
git diff --staged --quiet || git commit -m "Update Org README from daemonless-io [skip ci]"
git push
- name: Build site
run: |
cd daemonless-io
make build
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: daemonless-io/site/
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
- name: Checkout
uses: actions/checkout@v6
- name: Notify Discord on outdated images
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_VERSION_WEBHOOK }}
GH_TOKEN: ${{ github.token }}
run: |
set +e
python3 scripts/compare-versions.py > /tmp/versions.json 2>/dev/null
EXIT=$?
set -e
if [ $EXIT -eq 0 ] || [ -z "$DISCORD_WEBHOOK" ] || [ ! -s /tmp/versions.json ]; then
exit 0
fi
COUNT=$(jq '.summary.outdated_count // 0' /tmp/versions.json)
if [ "$COUNT" -eq 0 ]; then
exit 0
fi
DESCRIPTION=$(jq -r '
.outdated[] as $item |
(.base_names[$item.name] // $item.name) as $base |
"**[\($item.name)](https://daemonless.io/images/\($item.name))**: " +
($item.updates | map(
"[\(.tag)](https://github.com/daemonless/\($base)/actions/workflows/build.yaml) `\(.deployed) → \(.available)`"
) | join(", "))
' /tmp/versions.json | awk '{printf "%s\\n", $0}')
curl -s -X POST "$DISCORD_WEBHOOK" \
-H "Content-Type: application/json" \
-d "$(jq -n \
--arg desc "$DESCRIPTION" \
--arg count "$COUNT" \
'{embeds: [{title: "🔄 \($count) outdated image(s)", description: $desc, color: 16744272}]}')"
- name: Ping IndexNow
run: |
curl -s -X POST "https://api.indexnow.org/indexnow" \
-H "Content-Type: application/json" \
-d '{
"host": "daemonless.io",
"key": "9165b253e91b4c86a023f24a2335428b",
"keyLocation": "https://daemonless.io/9165b253e91b4c86a023f24a2335428b.txt",
"urlList": [
"https://daemonless.io/",
"https://daemonless.io/status/",
"https://daemonless.io/images/",
"https://daemonless.io/guides/quick-start/",
"https://daemonless.io/guides/dbuild/",
"https://daemonless.io/community/",
"https://daemonless.io/philosophy/"
]
}'