Skip to content

Attest memcached

Attest memcached #10

Workflow file for this run

name: Attest memcached
on:
workflow_dispatch:
jobs:
build-artifact-ghcr:
name: Build/Attest Artifact (GHCR)
runs-on: ubuntu-latest
permissions:
id-token: write
attestations: write
packages: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: bdehamer/memcached
steps:
- name: Build Dockerfile
run: |
date > timestamp.txt
cat <<EOF > Dockerfile
FROM memcached:latest
COPY timestamp.txt .
EOF
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: push
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: .
platforms: 'linux/amd64,linux/arm64'
push: true
sbom: false
provenance: false
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:pgi
- name: Attest artifact
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
- name: Fetch artifact index
run: |
oras discover --format json ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:pgi | jq
- name: Build and push
id: push2
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: .
platforms: 'linux/amd64,linux/arm64'
push: true
sbom: false
provenance: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:github
- name: Attest artifact
env:
INPUT_PRIVATE-SIGNING: "false"
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.push2.outputs.digest }}
push-to-registry: true