Skip to content
Latchkey

Deploy workflow (pmorissette/ffn)

The Deploy workflow from pmorissette/ffn, explained and optimized by Latchkey.

C

CI health: C - fair

Run this on Latchkey for self-healing, caching, and up to 58% lower cost.

Grade your own workflow free or run it on Latchkey →
Source: pmorissette/ffn.github/workflows/deploy.yamlLicense MITView source

What it does

This is the Deploy workflow from the pmorissette/ffn repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
name: Deploy

on:
  push:
    tags:
      - 'v*'
  workflow_dispatch:

jobs:
  build:
    runs-on: ${{ matrix.os }}
    environment: dev

    strategy:
      matrix:
        os: [ubuntu-latest]
        python-version: ['3.10']

    steps:
    - name: Checkout
      uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1  # v6.3.0
      with:
        python-version: ${{ matrix.python-version }}
        cache: 'pip'
        cache-dependency-path: 'pyproject.toml'

    - name: Install dependencies
      run: make develop

    - name: Lint
      run: make lint

    - name: Test
      run: make test

    - name: Package and check
      run: make dist

    - name: Check sdist
      run: twine check dist/*

    - name: Upload SDist
      uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
      with:
        name: dist
        path: dist/

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: Deploy
 
on:
  push:
    tags:
      - 'v*'
  workflow_dispatch:
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  build:
    timeout-minutes: 30
    runs-on: ${{ matrix.os }}
    environment: dev
 
    strategy:
      matrix:
        os: [ubuntu-latest]
        python-version: ['3.10']
 
    steps:
    - name: Checkout
      uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
 
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1  # v6.3.0
      with:
        python-version: ${{ matrix.python-version }}
        cache: 'pip'
        cache-dependency-path: 'pyproject.toml'
 
    - name: Install dependencies
      run: make develop
 
    - name: Lint
      run: make lint
 
    - name: Test
      run: make test
 
    - name: Package and check
      run: make dist
 
    - name: Check sdist
      run: twine check dist/*
 
    - name: Upload SDist
      uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
      with:
        name: dist
        path: dist/
 
 

What changed

This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow