Skip to content

Instantly share code, notes, and snippets.

@possebon
Created December 19, 2025 17:51
Show Gist options
  • Select an option

  • Save possebon/fd3896adc36826ff01b476fa56946692 to your computer and use it in GitHub Desktop.

Select an option

Save possebon/fd3896adc36826ff01b476fa56946692 to your computer and use it in GitHub Desktop.
Open Source Infrastructure Stack - 20-github-actions-workflow

GitHub Actions GitOps Workflow

# .github/workflows/deploy.yml
name: Deploy Infrastructure

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Setup OpenTofu
        uses: opentofu/setup-opentofu@v1

      - name: Apply Infrastructure
        env:
          INFISICAL_CLIENT_ID: ${{ secrets.INFISICAL_CLIENT_ID }}
          INFISICAL_CLIENT_SECRET: ${{ secrets.INFISICAL_CLIENT_SECRET }}
        run: |
          tofu init
          tofu apply -auto-approve

This workflow enables GitOps-style infrastructure deployment. Push to main triggers automatic infrastructure provisioning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment