-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yaml
66 lines (60 loc) · 1.97 KB
/
action.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
name: 'Diploi Builder Action'
description: 'An action that builds components from a Diploi stack'
branding:
icon: 'package'
color: 'purple'
inputs:
identifier:
description: 'The identifier for the component'
required: true
folder:
description: 'The folder for the component'
required: true
name:
description: 'Optional name for the build'
type:
description: 'The type of this build'
project:
description: 'Project name for the Diploi Docker registry'
required: true
registry:
description: 'Hostname for the Diploi Docker registry'
required: true
username:
description: 'User for the Diploi Docker registry'
required: true
password:
description: 'Password for the Diploi Docker registry'
required: true
runs:
using: composite
steps:
- name: 'Set up QEMU'
uses: docker/setup-qemu-action@v3
- name: 'Set up Docker Buildx'
uses: docker/setup-buildx-action@v3
- name: 'Docker Meta'
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.registry }}/${{ env.project }}/${{ inputs.identifier }}
tags: |
type=ref,event=branch,enable=${{ inputs.type == 'main-dev' || inputs.type == 'main' }}
type=ref,event=branch,suffix=-dev.,enable=${{ inputs.type == 'main-dev' || inputs.type == 'dev' }}
- name: 'Log in to the Diploi Container Registry'
uses: docker/login-action@v2
with:
registry: ${{ env.registry }}
username: ${{ env.username }}
password: ${{ env.password }}
- name: 'Build And Push'
uses: docker/build-push-action@v6
with:
file: ${{ inputs.folder }}/${{ inputs.type == 'dev' && 'Dockerfile.dev' || 'Dockerfile' }}
pull: true
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
FOLDER=/app/${{ inputs.folder }}