Skip to content

Commit

Permalink
feat: add workflow for promoting 'latest' docker tag (#93)
Browse files Browse the repository at this point in the history
- Don't automatically promote 'latest' tag
  • Loading branch information
sreya authored Aug 22, 2024
1 parent 0d37a62 commit eaa5985
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 5 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/latest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: promote-latest

on:
workflow_dispatch:
inputs:
tag:
description: "The tag to point latest to"
required: true

permissions:
actions: read
checks: none
contents: write
deployments: none
issues: none
packages: write
pull-requests: none
repository-projects: none
security-events: none
statuses: none

jobs:
manifest:
runs-on: ubuntu-22.04
needs: release
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.inputs.tag }}
- name: Docker Login
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create Manifest
run: |
docker manifest create ghcr.io/coder/envbox:latest \
--amend ghcr.io/coder/envbox:${{ github.event.inputs.tag }}-amd64 \
--amend ghcr.io/coder/envbox:${{ github.event.inputs.tag }}-arm64
- name: Push Manifest
run: |
docker manifest push ghcr.io/coder/envbox:latest
5 changes: 0 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,9 @@ jobs:
docker manifest create ghcr.io/coder/envbox:${{ github.event.inputs.version }} \
--amend ghcr.io/coder/envbox:${{ github.event.inputs.version }}-amd64 \
--amend ghcr.io/coder/envbox:${{ github.event.inputs.version }}-arm64
docker manifest create ghcr.io/coder/envbox:latest \
--amend ghcr.io/coder/envbox:${{ github.event.inputs.version }}-amd64 \
--amend ghcr.io/coder/envbox:${{ github.event.inputs.version }}-arm64
- name: Push Manifest
run: |
docker manifest push ghcr.io/coder/envbox:${{ github.event.inputs.version }}
docker manifest push ghcr.io/coder/envbox:latest
tag:
runs-on: ubuntu-22.04
Expand Down

0 comments on commit eaa5985

Please sign in to comment.