Skip to content
Latchkey

GitHub Actions Workflow Template for Deploy to AWS (OIDC)

A complete, caching-enabled GitHub Actions workflow for Deploy to AWS (OIDC). Drop it in .github/workflows/ci.yml and adjust.

This template builds and tests a Deploy to AWS (OIDC) project with dependency caching and sensible defaults. It authenticates with OIDC - no static AWS keys.

The workflow

.github/workflows/ci.yml
name: Deploy
on:
  push:
    branches: [main]
permissions:
  id-token: write
  contents: read
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: aws-actions/configure-aws-credentials@v4
        with:
          role-to-assume: arn:aws:iam::1234567890:role/gha-deploy
          aws-region: us-east-1
      - run: ./deploy.sh

What it does

  • Assumes an IAM role via OIDC
  • Deploys on push to main

Run it cheaper

Change runs-on: ubuntu-latest to a Latchkey label to run this same workflow at roughly 69% lower per-minute cost, with self-healing for transient failures.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →