Signed-off-by: Gato <cedric@goutailler-olivier.fr>
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
name: Rollback
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Version cible (ex: v1.2.3)'
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
rollback:
|
||||
name: Rollback to ${{ inputs.version }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Login to Gitea container registry
|
||||
uses: https://github.com/docker/login-action@v3
|
||||
with:
|
||||
registry: git.goutailler-olivier.com
|
||||
username: ${{ gitea.actor }}
|
||||
password: ${{ secrets.RELEASE_TOKEN }}
|
||||
|
||||
- name: Set lowercase repo name
|
||||
id: repo
|
||||
run: echo "name=$(echo '${{ gitea.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Retag version as latest in registry
|
||||
run: |
|
||||
docker pull git.goutailler-olivier.com/${{ steps.repo.outputs.name }}:${{ inputs.version }}
|
||||
docker tag git.goutailler-olivier.com/${{ steps.repo.outputs.name }}:${{ inputs.version }} git.goutailler-olivier.com/${{ steps.repo.outputs.name }}:latest
|
||||
docker push git.goutailler-olivier.com/${{ steps.repo.outputs.name }}:latest
|
||||
|
||||
- name: Trigger production deployment
|
||||
run: |
|
||||
curl -sf -X POST \
|
||||
-H "Authorization: Bearer ${{ secrets.WATCHTOWER_TOKEN }}" \
|
||||
https://watchtower.goutailler-olivier.com/v1/update
|
||||
Reference in New Issue
Block a user