Skip to content

Commit bcb6277

Browse files
chore: Turn on latest tagging for docker builds (#23)
Previously we turned this off to test that the multi-arch builds actually work. We've verified that we were successfully able to build and push a mulit-arch image, so now we can turn back on the latest tagging. This new approach changes things just a bit. It turns this from relying on new tag pushes to instead being manually activated. Deploying now will involved someone activating the github action to build the new docker container and being able to choose whether it tags the image it will build as "latest" or not.
1 parent bcd2a5d commit bcb6277

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

.github/workflows/docker-publish.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
name: Docker
22

33
on:
4-
push:
5-
# Publish semver tags as releases.
6-
tags: [ 'v*.*.*' ]
4+
workflow_dispatch:
5+
inputs:
6+
set_latest_tag:
7+
description: 'Set to true to tag the image with `latest`'
8+
required: true
9+
default: false
10+
type: boolean
711

812
env:
913
REGISTRY: docker.io
1014
IMAGE_NAME: fanout/pushpin
15+
SET_LATEST: ${{ github.event.inputs.set_latest_tag }}
1116

1217
jobs:
1318
build:
@@ -41,7 +46,7 @@ jobs:
4146
with:
4247
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4348
flavor: |
44-
latest=false
49+
latest=${{ env.SET_LATEST }}
4550
tags: |
4651
type=ref,event=branch,pattern={{branch}}
4752
type=semver,pattern={{version}},value=${{ env.SOURCE_VERSION }}
@@ -97,7 +102,7 @@ jobs:
97102
with:
98103
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
99104
flavor: |
100-
latest=false
105+
latest=${{ env.SET_LATEST }}
101106
tags: |
102107
type=ref,event=branch,pattern={{branch}}
103108
type=semver,pattern={{version}},value=${{ env.SOURCE_VERSION }}

0 commit comments

Comments
 (0)