1
1
name : Docker image
2
2
3
3
on :
4
- workflow_dispatch :
4
+ release :
5
+ types : [published]
5
6
6
7
permissions :
7
8
packages : write
9
+ attestations : write
8
10
9
11
env :
10
- IMAGE_NAME : qemu-docker-anti-detection
11
- IMAGE_REGISTRY : ghcr.io/winapps-org
12
- REGISTRY_USER : actions
13
- REGISTRY_PASSWORD : ${{ secrets.GITHUB_TOKEN }}
12
+ IMAGE_REGISTRY : ghcr.io
13
+ IMAGE_NAME : winapps-org/qemu-docker-anti-detection
14
14
15
15
jobs :
16
16
build :
@@ -36,12 +36,19 @@ jobs:
36
36
echo "build=$(date --rfc-3339 ns)" >> $GITHUB_OUTPUT
37
37
echo "tag=$(date +%Y%m%d)" >> $GITHUB_OUTPUT
38
38
39
+ - name : Extract metadata (tags, labels) for Docker
40
+ id : meta
41
+ uses : docker/metadata-action@v4
42
+ with :
43
+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
44
+
39
45
- name : Build image
40
46
id : base
41
47
uses : redhat-actions/buildah-build@v2
42
48
with :
43
49
image : ${{ env.IMAGE_NAME }}
44
- tags : ${{ steps.date.outputs.tag }} latest
50
+ tags : ${{ steps.meta.outputs.tags }}
51
+ labels : ${{ steps.meta.outputs.labels
45
52
context : .
46
53
platforms : linux/${{ matrix.platform }}
47
54
containerfiles : |
57
64
image : ${{ steps.base.outputs.image }}
58
65
tags : ${{ steps.base.outputs.tags }}
59
66
registry : ${{ env.IMAGE_REGISTRY }}
60
- username : ${{ env.REGISTRY_USER }}
61
- password : ${{ env.REGISTRY_PASSWORD }}
67
+ username : ${{ github.actor }}
68
+ password : ${{ secrets.GITHUB_TOKEN }}
69
+
70
+ - name : Generate artifact attestation
71
+ uses : actions/attest-build-provenance@v1
72
+ with :
73
+ subject-name : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
74
+ subject-digest : ${{ steps.push.outputs.digest }}
75
+ push-to-registry : true
0 commit comments