From 419fb5f54e24ee2c57f0ea1340945ea3c15c0c93 Mon Sep 17 00:00:00 2001 From: Alex Ivantsov Date: Tue, 30 Jun 2026 23:36:45 -0400 Subject: [PATCH] perf(ci): cache docker layers, skip docs-only builds, add GHCR retention Claude-Session: https://claude.ai/code/session_01PHs12fajWK64nVLK6oZ2PQ --- .github/workflows/deploy.yml | 5 ++++- .github/workflows/ghcr-cleanup.yml | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ghcr-cleanup.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index fe49e80..9459d64 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,6 +3,7 @@ name: Build and Push Docker on: push: branches: ['main'] # Only run when code hits Main + paths-ignore: ['**.md'] env: REGISTRY: ghcr.io @@ -41,4 +42,6 @@ jobs: context: . push: true tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file diff --git a/.github/workflows/ghcr-cleanup.yml b/.github/workflows/ghcr-cleanup.yml new file mode 100644 index 0000000..ae0e7ca --- /dev/null +++ b/.github/workflows/ghcr-cleanup.yml @@ -0,0 +1,19 @@ +name: GHCR cleanup +on: + workflow_dispatch: + inputs: + dry_run: { description: "Preview only", type: boolean, default: true } +permissions: { packages: write } +jobs: + cleanup: + runs-on: ubuntu-latest + steps: + - uses: dataaxiom/ghcr-cleanup-action@v1 + with: + owner: Exploitacious + packages: ivantsov.tech + delete-untagged: true + keep-n-tagged: 10 + exclude-tags: latest + dry-run: ${{ inputs.dry_run }} + token: ${{ secrets.GITHUB_TOKEN }}