Skip to content

chezmoi: handle fedora as well as fedora-like :D #146

chezmoi: handle fedora as well as fedora-like :D

chezmoi: handle fedora as well as fedora-like :D #146

Workflow file for this run

name: Build and push image to GitHub Container Registry
on:
push:
paths-ignore:
- "**.md"
pull_request:
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: yacoob/interactive
SHOULD_PUSH: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
jobs:
build:
name: Build and optionally push ${{ matrix.target }} image
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
target: [base, devenv]
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Set image names
run: |
echo "TARGET=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
if: ${{ env.SHOULD_PUSH == 'true' }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Work out container tags
uses: docker/metadata-action@v5
id: docker-meta
with:
images: ${{ env.TARGET }}
tags: |
type=sha,suffix=-${{ matrix.target }}
type=raw,value=${{ matrix.target }},enable={{ is_default_branch }}
- name: Set up docker builder (buildx)
uses: docker/setup-buildx-action@v3
- name: Build and optionally push the ${{ matrix.target }} version
uses: docker/build-push-action@v6
id: build
with:
target: ${{ matrix.target }}
context: .
file: ./docker/Containerfile
push: ${{ env.SHOULD_PUSH == 'true' }}
labels: ${{ steps.docker-meta.outputs.labels }}
tags: ${{ steps.docker-meta.outputs.tags }}
cache-to: type=gha,mode=max
cache-from: type=gha
- name: Notify dependent repositories
if: ${{ env.SHOULD_PUSH == 'true' && matrix.target == 'base' }}
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.PUBLIC_REPO_TOKEN }}
repository: yacoob/docker-beets
event-type: dependency-updated
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.TARGET }}
subject-digest: ${{ steps.build.outputs.digest }}
push-to-registry: ${{ env.SHOULD_PUSH == 'true' }}