Skip to content

Commit eaa5985

Browse files
authored
feat: add workflow for promoting 'latest' docker tag (#93)
- Don't automatically promote 'latest' tag
1 parent 0d37a62 commit eaa5985

File tree

2 files changed

+46
-5
lines changed

2 files changed

+46
-5
lines changed

.github/workflows/latest.yaml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: promote-latest
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: "The tag to point latest to"
8+
required: true
9+
10+
permissions:
11+
actions: read
12+
checks: none
13+
contents: write
14+
deployments: none
15+
issues: none
16+
packages: write
17+
pull-requests: none
18+
repository-projects: none
19+
security-events: none
20+
statuses: none
21+
22+
jobs:
23+
manifest:
24+
runs-on: ubuntu-22.04
25+
needs: release
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v3
29+
with:
30+
fetch-depth: 0
31+
ref: ${{ github.event.inputs.tag }}
32+
- name: Docker Login
33+
uses: docker/login-action@v2
34+
with:
35+
registry: ghcr.io
36+
username: ${{ github.actor }}
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
- name: Create Manifest
39+
run: |
40+
docker manifest create ghcr.io/coder/envbox:latest \
41+
--amend ghcr.io/coder/envbox:${{ github.event.inputs.tag }}-amd64 \
42+
--amend ghcr.io/coder/envbox:${{ github.event.inputs.tag }}-arm64
43+
44+
- name: Push Manifest
45+
run: |
46+
docker manifest push ghcr.io/coder/envbox:latest

.github/workflows/release.yaml

-5
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,9 @@ jobs:
103103
docker manifest create ghcr.io/coder/envbox:${{ github.event.inputs.version }} \
104104
--amend ghcr.io/coder/envbox:${{ github.event.inputs.version }}-amd64 \
105105
--amend ghcr.io/coder/envbox:${{ github.event.inputs.version }}-arm64
106-
docker manifest create ghcr.io/coder/envbox:latest \
107-
--amend ghcr.io/coder/envbox:${{ github.event.inputs.version }}-amd64 \
108-
--amend ghcr.io/coder/envbox:${{ github.event.inputs.version }}-arm64
109-
110106
- name: Push Manifest
111107
run: |
112108
docker manifest push ghcr.io/coder/envbox:${{ github.event.inputs.version }}
113-
docker manifest push ghcr.io/coder/envbox:latest
114109
115110
tag:
116111
runs-on: ubuntu-22.04

0 commit comments

Comments
 (0)