-
Notifications
You must be signed in to change notification settings - Fork 267
74 lines (67 loc) · 2 KB
/
docker_deploy.yml
File metadata and controls
74 lines (67 loc) · 2 KB
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
72
73
74
name: Deploy Docker Image
on:
workflow_call:
inputs:
version:
description: "The version number"
required: true
type: string
registry:
description: "The Docker Registry"
default: "ghcr.io"
required: false
type: string
image_name:
description: "The Docker image name"
default: ${{ github.repository }}
required: false
type: string
build_image:
description: "The Docker Build Image (repository) to deploy"
required: true
type: string
build_image_tag:
description: "The Docker Build Image Tag to retag from"
required: true
type: string
deploy_tag:
description: "The target tag to deploy as"
required: true
type: string
environment:
description: "The GitHub environment to deploy to"
required: true
type: string
platforms:
description: "The platforms to deploy"
required: false
type: string
default: linux/amd64,linux/arm64
outputs:
image:
description: "The deployed image"
value: ${{ jobs.deploy.outputs.image }}
jobs:
deploy:
name: ${{ inputs.environment && format('Deploy {0} Image', inputs.environment) || 'Deploy Image' }}
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
permissions:
contents: read
packages: write
attestations: write
outputs:
image: ${{ steps.output.outputs.image }}
steps:
- name: Deploy to ${{ inputs.environment }}
uses: shrink/actions-docker-registry-tag@v4
with:
registry: ${{ inputs.registry }}
repository: ${{ inputs.build_image }}
target: ${{ inputs.build_image_tag }}
tags: |
${{ inputs.deploy_tag }}
- name: Store outputs
id: output
run: |
echo "image=${{ inputs.registry }}/${{ inputs.image_name }}:${{ inputs.deploy_tag }}" >> "$GITHUB_OUTPUT"