49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
name: Deploy home services
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
schedule:
|
|
# Gitea schedules are UTC. 09:00 UTC is 03:00 at the fixed UTC-6 offset.
|
|
# The job runs each Friday, then gates itself to the first Friday.
|
|
- cron: "0 9 * * 5"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
deploy-nas1:
|
|
runs-on: nas1
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Deploy media_nas1
|
|
shell: bash
|
|
run: |
|
|
if [[ "$GITHUB_EVENT_NAME" == "schedule" ]]; then
|
|
day="$(date -u +%-d)"
|
|
if (( day > 7 )); then
|
|
echo "Not the first Friday of the month; skipping NAS1 deployment."
|
|
exit 0
|
|
fi
|
|
fi
|
|
python3 composectl.py refresh --stack media_nas1 --runtime docker --prune
|
|
|
|
deploy-rhel1:
|
|
runs-on: rhel1
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Deploy media_rhel1
|
|
shell: bash
|
|
run: |
|
|
if [[ "$GITHUB_EVENT_NAME" == "schedule" ]]; then
|
|
day="$(date -u +%-d)"
|
|
if (( day > 7 )); then
|
|
echo "Not the first Friday of the month; skipping RHEL1 deployment."
|
|
exit 0
|
|
fi
|
|
fi
|
|
python3 composectl.py refresh --stack media_rhel1 --runtime podman --prune
|