Skip to content

Linux build sandboxes #1

Linux build sandboxes

Linux build sandboxes #1

Workflow file for this run

name: docker
on:
pull_request:
push:
branches:
- main
env:
IMAGE_NAME: ${{ github.repository }}
REGISTRY: ghcr.io
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
attestations: write
contents: read
id-token: write
packages: write
steps:
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- if: github.event_name != 'pull_request'
uses: docker/login-action@3
with:
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
- id: meta
uses: docker/metadata-action@5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=edge,branch=main
type=ref,event=pr
type=ref,event=tag
- uses: actions/checkout@v4
- id: push
uses: docker/build-push-action@6
with:
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
labels: ${{ steps.meta.outputs.labels }}
push: github.event_name != 'pull_request'
tags: ${{ steps.meta.outputs.tags }}
- uses: actions/attest-build-provenance@v1
with:
push-to-registry: github.event_name != 'pull_request'
subject-digest: ${{ steps.push.outputs.digest }}
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}