build cache #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish and Sign Container Image | |
env: | |
REGISTRY: ghcr.io | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- .github/workflows/build.yml | |
- "**/Containerfile" | |
# schedule: | |
# - cron: "17 07 * * 0" | |
jobs: | |
build-push-image: | |
runs-on: ubuntu-24.04 | |
container: | |
image: quay.io/containers/aio | |
options: --privileged | |
permissions: | |
contents: read | |
packages: write | |
id-token: write | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- image: spotify-distrobox | |
file: distroboxes/spotify/Containerfile | |
- image: steam-distrobox | |
file: distroboxes/steam/Containerfile | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Cache podman | |
uses: actions/cache@v3 | |
with: | |
path: ~/.local/share/containers | |
key: ${{ matrix.image }} | |
- name: Buildah image | |
uses: redhat-actions/buildah-build@v2 | |
id: build | |
with: | |
image: ${{ matrix.image }} | |
tags: latest ${{ github.sha }} | |
containerfiles: | | |
${{ matrix.file }} | |
context: . | |
oci: true | |
layers: true | |
# - name: Push To GHCR | |
# uses: redhat-actions/push-to-registry@v2 | |
# id: push | |
# env: | |
# SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
# with: | |
# image: ${{ steps.build.outputs.image }} | |
# tags: ${{ steps.build.outputs.tags }} | |
# registry: | | |
# ${{ env.REGISTRY }}/${{ github.repository_owner }} | |
# username: ${{ github.repository_owner }} | |
# password: ${{ github.token }} | |
# extra-args: | | |
# --sign-by-sigstore=env://SIGNING_KEY | |
- name: Cleanup old images | |
uses: actions/delete-package-versions@v5 | |
with: | |
package-name: ${{ matrix.image }} | |
package-type: container | |
min-versions-to-keep: 60 | |