|
1 | 1 | name: CD - Publish Docker image on ghcr.io
|
2 | 2 |
|
3 |
| -# This workflow uses actions that are not certified by GitHub. |
4 |
| -# They are provided by a third-party and are governed by |
| 3 | +# cos |
5 | 4 | # separate terms of service, privacy policy, and support
|
6 | 5 | # documentation.
|
7 | 6 |
|
@@ -38,33 +37,39 @@ jobs:
|
38 | 37 |
|
39 | 38 | - name: Install Cosign
|
40 | 39 |
|
| 40 | + # with: |
| 41 | + # cosign-release: 'v2.2.4' # optional |
41 | 42 |
|
42 | 43 | - name: Set up QEMU
|
43 |
| - uses: docker/setup-qemu-action@v2.2.0 |
| 44 | + uses: docker/setup-qemu-action@v3.2.0 |
44 | 45 |
|
45 | 46 | - name: Set up Docker Buildx
|
46 |
| - uses: docker/setup-buildx-action@v2.10.0 |
| 47 | + uses: docker/setup-buildx-action@v3.5.0 |
47 | 48 |
|
48 | 49 | - name: Login to GitHub Container Registry
|
49 |
| - uses: docker/login-action@v2.2.0 |
| 50 | + uses: docker/login-action@v3.3.0 |
50 | 51 | with:
|
51 |
| - registry: ghcr.io |
| 52 | + registry: ${{ env.REGISTRY }} |
52 | 53 | username: ${{ github.actor }}
|
53 | 54 | password: ${{ secrets.GITHUB_TOKEN }}
|
54 | 55 |
|
55 | 56 | - id: docker_meta
|
56 | 57 |
|
57 | 58 | with:
|
58 |
| - images: ghcr.io/sigstore/sample-honk |
| 59 | + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
59 | 60 | tags: type=sha,format=long
|
60 | 61 |
|
61 | 62 | - name: Build and Push container images
|
62 |
| - uses: docker/build-push-action@v4.2.1 |
| 63 | + uses: docker/build-push-action@v6.5.0 |
63 | 64 | id: build-and-push
|
64 | 65 | with:
|
65 | 66 | platforms: linux/amd64,linux/arm64
|
66 | 67 | push: true
|
67 | 68 | tags: ${{ steps.docker_meta.outputs.tags }}
|
| 69 | + labels: ${{ steps.docker_meta.outputs.labels }} |
| 70 | + cache-from: type=gha |
| 71 | + cache-to: type=gha,mode=max |
| 72 | + # outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=${{ fromJSON(steps.docker_meta.outputs.json).labels['org.opencontainers.image.description'] }} |
68 | 73 |
|
69 | 74 | # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
|
70 | 75 | - name: Sign image with a key
|
|
0 commit comments