Nightly Publish workflow (openwallet-foundation/acapy)
The Nightly Publish workflow from openwallet-foundation/acapy, explained and optimized by Latchkey.
CI health: A - excellent
Point runs-on at Latchkey and get job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the Nightly Publish workflow from the openwallet-foundation/acapy repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: Nightly Publish
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
tests:
if: github.repository_owner == 'openwallet-foundation' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
checks: write
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.13"]
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Run Tests
uses: ./.github/actions/run-unit-tests
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
is_pr: "false"
setup_and_check_pub:
name: Setup Publish
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
commits_today: ${{ steps.commits.outputs.commits_today }}
date: ${{ steps.date.outputs.date }}
if: github.repository_owner == 'openwallet-foundation' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Print Latest Commit
run: echo ${{ github.sha }}
- name: Get New Commits
id: commits
run: echo "commits_today=$(git log --oneline --since '24 hours ago' | wc -l)" >> $GITHUB_OUTPUT
- name: Get Date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
publish:
name: Publish
needs: [tests, setup_and_check_pub]
if: needs.setup_and_check_pub.outputs.commits_today > 0
uses: ./.github/workflows/publish.yml
strategy:
matrix:
tag: ["nightly-${{needs.setup_and_check_pub.outputs.date}}", nightly]
permissions:
contents: read
pull-requests: read
packages: write
with:
tag: ${{ matrix.tag }}
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Nightly Publish on: schedule: - cron: "0 0 * * *" workflow_dispatch: jobs: tests: timeout-minutes: 30 if: github.repository_owner == 'openwallet-foundation' || github.event_name == 'workflow_dispatch' runs-on: latchkey-small permissions: contents: read pull-requests: read checks: write strategy: fail-fast: false matrix: os: ["ubuntu-latest"] python-version: ["3.13"] steps: - name: Checkout uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Run Tests uses: ./.github/actions/run-unit-tests with: python-version: ${{ matrix.python-version }} os: ${{ matrix.os }} is_pr: "false" setup_and_check_pub: timeout-minutes: 30 name: Setup Publish runs-on: latchkey-small permissions: contents: read pull-requests: read outputs: commits_today: ${{ steps.commits.outputs.commits_today }} date: ${{ steps.date.outputs.date }} if: github.repository_owner == 'openwallet-foundation' || github.event_name == 'workflow_dispatch' steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Print Latest Commit run: echo ${{ github.sha }} - name: Get New Commits id: commits run: echo "commits_today=$(git log --oneline --since '24 hours ago' | wc -l)" >> $GITHUB_OUTPUT - name: Get Date id: date run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT publish: timeout-minutes: 30 name: Publish needs: [tests, setup_and_check_pub] if: needs.setup_and_check_pub.outputs.commits_today > 0 uses: ./.github/workflows/publish.yml strategy: matrix: tag: ["nightly-${{needs.setup_and_check_pub.outputs.date}}", nightly] permissions: contents: read pull-requests: read packages: write with: tag: ${{ matrix.tag }}
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - Add a job timeout so a hung step cannot burn hours of runner time.
This workflow runs 3 jobs (4 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.