Skip to content
Latchkey

Nightly Publish workflow (openwallet-foundation/acapy)

The Nightly Publish workflow from openwallet-foundation/acapy, explained and optimized by Latchkey.

A

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.

Grade your own workflow free or run it on Latchkey →
Source: openwallet-foundation/acapy.github/workflows/nightly.ymlLicense Apache-2.0View source

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

workflow (.yml)
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

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.

Actions used in this workflow