-
Notifications
You must be signed in to change notification settings - Fork 109
70 lines (64 loc) · 2.27 KB
/
release_image.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
name: Release Docker image
on:
repository_dispatch:
types:
- release-triggered
workflow_dispatch:
# None of these are necessary - an automated release will work out what needs to be incremented
# Can set any of the following:
# increment (will default to minor if not set)
# tag
# increment/version
inputs:
increment:
description: "Custom increment, defaults to minor if not set"
required: false
default: ""
type: choice
options:
- ""
- patch
- minor
- major
- pre
# Sets the first part of the Docker tag - this will update the VERSION file
version:
description: "Custom version, requires increment to be set"
required: false
tag:
description: "Custom Docker image tag (note - this won't update the VERSION file and is for non-prod releases only)"
required: false
push_to_latest:
description: 'Should push to latest'
type: boolean
default: true
docker_repository:
description: The Docker repository to which the image should be published
default: pactfoundation
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ruby/setup-ruby@v1
- run: "bundle install"
- name: Log into ghcr registry
if: github.event_name != 'pull_request'
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Release image
run: script/release-workflow/run.sh
env:
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
DOCKER_REPOSITORY: ${{ github.event.inputs.docker_repository }}
TAG: ${{ github.event.inputs.tag }}
VERSION: ${{ github.event.inputs.version }}
# populate INCREMENT from workflow_dispatch or repository_dispatch
INCREMENT: ${{ github.event.client_payload.increment }}${{ github.event.inputs.increment }}
PUSH_TO_LATEST: ${{ github.event.inputs.push_to_latest }}