Add manual Forgejo action to promote :latest → :prod
All checks were successful
Build and Push Docker Image / build-and-push-image (push) Successful in 1m14s
All checks were successful
Build and Push Docker Image / build-and-push-image (push) Successful in 1m14s
This commit is contained in:
parent
cf29664f0a
commit
c7e8109bbd
1 changed files with 41 additions and 0 deletions
41
.forgejo/workflows/promote_to_prod.yaml
Normal file
41
.forgejo/workflows/promote_to_prod.yaml
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
# =============================================================================
|
||||
# Forgejo Actions workflow to promote the "latest" image to "prod"
|
||||
# =============================================================================
|
||||
# Triggered manually via the Forgejo UI ("Run workflow" button).
|
||||
# Pulls the current :latest image and re-tags it as :prod.
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
name: Promote :latest → :prod
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
promote:
|
||||
runs-on: docker
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Install Docker CLI
|
||||
run: |
|
||||
apt-get update -qq
|
||||
apt-get install -y --no-install-recommends docker.io
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.workaround.org
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.FORGEJO_TOKEN }}
|
||||
|
||||
- name: Tag :latest → :prod
|
||||
run: |
|
||||
IMG="git.workaround.org/${{ github.repository }}"
|
||||
docker buildx imagetools create \
|
||||
--tag "${IMG}:prod" \
|
||||
"${IMG}:latest"
|
||||
Loading…
Add table
Add a link
Reference in a new issue