-
Notifications
You must be signed in to change notification settings - Fork 8
65 lines (56 loc) · 1.85 KB
/
docker.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: docker
on:
pull_request:
push:
branches:
- main
env:
IMAGE_NAME: ${{ github.repository }}-sandbox
REGISTRY: ghcr.io
jobs:
package:
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@v3
with:
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
- id: meta
uses: docker/metadata-action@v5
with:
annotations: |
org.opencontainers.image.description=Build and deliver software reliably with one magical tool.
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
labels: |
org.opencontainers.image.title=${{ env.IMAGE_NAME }}
org.opencontainers.image.description=Build and deliver software reliably with one magical tool.
org.opencontainers.image.vendor=ALT-F4-LLC
tags: |
type=edge,branch=main
- uses: actions/checkout@v4
- id: push
uses: docker/build-push-action@v6
with:
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
file: Dockerfile.sandbox
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
- if: github.event_name != 'pull_request'
uses: actions/attest-build-provenance@v1
with:
push-to-registry: true
subject-digest: ${{ steps.push.outputs.digest }}
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}