generated from jmeridth/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (71 loc) · 2.23 KB
/
release-image.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
66
67
68
69
70
71
---
name: "Release Image"
on:
workflow_call:
inputs:
image-name:
required: true
type: string
full-tag:
required: true
type: string
short-tag:
required: true
type: string
create-attestation:
required: false
type: boolean
default: false
secrets:
github-token:
required: true
image-registry:
required: true
image-registry-username:
required: true
image-registry-password:
required: true
jobs:
create_action_images:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
attestations: write
env:
IMAGE_REGISTRY: ${{ secrets.image-registry }}
IMAGE_REGISTRY_USERNAME: ${{ secrets.image-registry-username }}
IMAGE_REGISTRY_PASSWORD: ${{ secrets.image-registry-password }}
steps:
- uses: actions/[email protected]
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2
- name: Log in to the Container registry
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
with:
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ env.IMAGE_REGISTRY_USERNAME }}
password: ${{ env.IMAGE_REGISTRY_PASSWORD}}
- name: Push Docker Image
if: ${{ success() }}
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4
id: push
with:
context: .
file: ./Dockerfile
push: true
tags: |
${{ env.IMAGE_REGISTRY }}/${{ inputs.image-name }}:latest
${{ env.IMAGE_REGISTRY }}/${{ inputs.image-name }}:${{ inputs.full-tag }}
${{ env.IMAGE_REGISTRY }}/${{ inputs.image-name }}:${{ inputs.short-tag }}
platforms: linux/amd64,linux/arm64
provenance: false
sbom: false
- name: Generate artifact attestation
if: ${{ inputs.create-attestation }}
uses: actions/attest-build-provenance@v2
with:
subject-name: ${{ env.IMAGE_REGISTRY }}/${{ inputs.image-name}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true