-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
123 lines (112 loc) · 4.12 KB
/
action.yml
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Openzim Docker Publish Action
description: Build and publish Docker Images to both Docker Hub and ghcr.
author: openzim
branding:
icon: package
color: green
inputs:
image-name:
description: target image path on both registries (ex. 'openzim/dnscache')
required: true
registries:
description: list of registries to push to (defaults to docker.io ghcr.io)
required: false
default: ghcr.io
credentials:
description: list of credentials for each registry. Ex. DOCKERIO_USERNAME=xxx DOCKERIO_TOKEN=yyy GHCRIO_USERNAME=xxx
required: true
context:
description: folder to use as context for the build (ex. '.' or 'dnscache')
required: false
default: .
dockerfile:
description: Dockerfile path (relative to context) if not 'Dockerfile'
required: false
default: Dockerfile
build-args:
description: optional key/value pairs to pass as build arguments. {tag} replaced with found version (if any)
required: false
platforms:
description: specify platform to build for (one of linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6, etc)
required: false
default: linux/amd64
on-master:
description: tag to use on master commits. (ex. 'latest' or 'dev') Leave out if not wanted
required: false
tag-pattern:
description: pattern to trigger image tagging (ex. 'dnscache-v*')
required: false
latest-on-tag:
description: should matched tag (or manual-tag) be tagged as 'latest' also? (true or false)
required: false
default: false
manual-tag:
description: Specify the tag manually. Overrides on-master and tag-pattern.
required: false
default: ''
restrict-to:
description: repository path to limit this action to (ex. 'openzim/zimfarm') to prevent forks from triggering it.
required: false
webhook:
description: URL to request (POST) to after a sucessful push to registry•ies
required: false
default: ''
repo_description:
description: Text to set as repository description on docker.io (100 chars max)
required: false
repo_overview:
description: Text (markdown) to set as repository overview on docker.io (2.5MB max)
required: false
runs:
using: composite
steps:
- name: check and store params
run: python3 $GITHUB_ACTION_PATH/check_inputs.py
shell: bash
env:
IMAGE_NAME: ${{ inputs.image-name }}
REGISTRIES: ${{ inputs.registries }}
CREDENTIALS: ${{ inputs.credentials }}
CONTEXT: ${{ inputs.context }}
DOCKERFILE: ${{ inputs.dockerfile }}
BUILD_ARGS: ${{ inputs.build-args }}
PLATFORMS: ${{ inputs.platforms }}
ON_MASTER: ${{ inputs.on-master }}
TAG_PATTERN: ${{ inputs.tag-pattern }}
LATEST_ON_TAG: ${{ inputs.latest-on-tag }}
MANUAL_TAG: ${{ inputs.manual-tag }}
RESTRICT_TO: ${{ inputs.restrict-to }}
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
WEBHOOK_URL: ${{ inputs.webhook }}
REPO_DESCRIPTION: ${{ inputs.repo_description }}
REPO_FULL_DESCRIPTION: ${{ inputs.repo_overview }}
DOCKER_BUILDX_VERSION: 0.5.1
- name: find tag
run: python3 $GITHUB_ACTION_PATH/find_tag.py
shell: bash
- name: Display found tag
run: python3 $GITHUB_ACTION_PATH/display_tag.py
shell: bash
- name: docker install
run: python3 $GITHUB_ACTION_PATH/docker_install.py
shell: bash
- name: docker login
run: python3 $GITHUB_ACTION_PATH/docker_login.py
shell: bash
env:
CREDENTIALS: ${{ inputs.credentials }}
- name: docker build-push
run: python3 $GITHUB_ACTION_PATH/docker_build.py
shell: bash
- name: docker logout
run: python3 $GITHUB_ACTION_PATH/docker_logout.py
shell: bash
- name: update docker.io's Hub descriptions
run: python3 $GITHUB_ACTION_PATH/update_dockerio_descriptions.py
env:
CREDENTIALS: ${{ inputs.credentials }}
if: ${{ env.SHOULD_UPDATE_DOCKERIO }}
shell: bash
- name: run webhook
run: python3 $GITHUB_ACTION_PATH/run_webhook.py
shell: bash