Skip to content

ci(deps): bump the github-actions group with 2 updates (#2) #11

ci(deps): bump the github-actions group with 2 updates (#2)

ci(deps): bump the github-actions group with 2 updates (#2) #11

name: Build and Push Docker Image
on:
push:
branches:
- main
paths:
- "Dockerfile"
- ".github/workflows/**"
schedule:
# Rebuild weekly on Sundays to get latest packages
- cron: "17 0 * * 0"
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: coders-compass/debian-act-runner
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha,prefix={{branch}}-
type=ref,event=branch
type=schedule,pattern={{date 'YYYYMMDD'}}
- name: Build and push Docker image
id: build
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v3
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.build.outputs.digest }}
push-to-registry: true