Skip to content

Commit c5ca612

Browse files
authored
Merge pull request #808 from bcgov/feat/workflow
Enable manual workflow trigger with input to build pre-existing releases
2 parents 4df3ef8 + 3b416d3 commit c5ca612

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

.github/workflows/build_release.yaml

+29-12
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
release:
55
types: [published]
66
workflow_dispatch:
7+
inputs:
8+
tag:
9+
description: 'Tag to build (leave empty for latest)'
10+
required: false
11+
default: ''
712

813
permissions:
914
packages: write
@@ -15,7 +20,10 @@ jobs:
1520
runs-on: ubuntu-latest
1621
if: github.repository_owner == 'bcgov'
1722
steps:
18-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
ref: ${{ github.event.inputs.tag || github.ref }}
1927

2028
- name: Set up Docker Buildx
2129
uses: docker/setup-buildx-action@v3
@@ -33,10 +41,10 @@ jobs:
3341
with:
3442
images: ghcr.io/${{ github.repository }}/aries-vcr-agent
3543
tags: |
44+
type=raw,value=${{ github.event.inputs.tag }}
3645
type=semver,pattern={{version}}
3746
type=semver,pattern={{major}}.{{minor}}
38-
type=ref
39-
type=sha
47+
type=ref,event=tag
4048
4149
- name: Build and push image
4250
id: builder
@@ -53,7 +61,10 @@ jobs:
5361
runs-on: ubuntu-latest
5462
if: github.repository_owner == 'bcgov'
5563
steps:
56-
- uses: actions/checkout@v4
64+
- uses: actions/checkout@v4
65+
with:
66+
fetch-depth: 0
67+
ref: ${{ github.event.inputs.tag || github.ref }}
5768

5869
- name: Login to GitHub Container Registry
5970
uses: docker/login-action@v3
@@ -68,10 +79,10 @@ jobs:
6879
with:
6980
images: ghcr.io/${{ github.repository }}/aries-vcr-api
7081
tags: |
82+
type=raw,value=${{ github.event.inputs.tag }}
7183
type=semver,pattern={{version}}
7284
type=semver,pattern={{major}}.{{minor}}
73-
type=ref
74-
type=sha
85+
type=ref,event=tag
7586
7687
- name: Setup and build
7788
id: build_image
@@ -96,7 +107,10 @@ jobs:
96107
runs-on: ubuntu-latest
97108
if: github.repository_owner == 'bcgov'
98109
steps:
99-
- uses: actions/checkout@v4
110+
- uses: actions/checkout@v4
111+
with:
112+
fetch-depth: 0
113+
ref: ${{ github.event.inputs.tag || github.ref }}
100114

101115
- name: Login to GitHub Container Registry
102116
uses: docker/login-action@v3
@@ -111,10 +125,10 @@ jobs:
111125
with:
112126
images: ghcr.io/${{ github.repository }}/aries-vcr-db
113127
tags: |
128+
type=raw,value=${{ github.event.inputs.tag }}
114129
type=semver,pattern={{version}}
115130
type=semver,pattern={{major}}.{{minor}}
116-
type=ref
117-
type=sha
131+
type=ref,event=tag
118132
119133
- name: Setup and build
120134
id: build_image
@@ -139,7 +153,10 @@ jobs:
139153
runs-on: ubuntu-latest
140154
if: github.repository_owner == 'bcgov'
141155
steps:
142-
- uses: actions/checkout@v4
156+
- uses: actions/checkout@v4
157+
with:
158+
fetch-depth: 0
159+
ref: ${{ github.event.inputs.tag || github.ref }}
143160

144161
- name: Login to GitHub Container Registry
145162
uses: docker/login-action@v3
@@ -154,10 +171,10 @@ jobs:
154171
with:
155172
images: ghcr.io/${{ github.repository }}/aries-vcr-solr
156173
tags: |
174+
type=raw,value=${{ github.event.inputs.tag }}
157175
type=semver,pattern={{version}}
158176
type=semver,pattern={{major}}.{{minor}}
159-
type=ref
160-
type=sha
177+
type=ref,event=tag
161178
162179
- name: Setup and build
163180
id: build_image

0 commit comments

Comments
 (0)