33 lines
1.0 KiB
YAML
33 lines
1.0 KiB
YAML
name: Docker build test
|
|
|
|
on:
|
|
workflow_call:
|
|
secrets:
|
|
password:
|
|
description: "Password or personal access token used to log against the Docker registry"
|
|
required: true
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
if: ${{ startsWith(gitea.ref, 'refs/tags/v') }}
|
|
steps:
|
|
- uses: docker/metadata-action@v5
|
|
id: meta
|
|
with:
|
|
images: ${{ vars.CONTAINER_REGISTRY }}/${{ gitea.repository }}
|
|
- uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ vars.CONTAINER_REGISTRY }}
|
|
username: ${{ vars.CONTAINER_REGISTRY_USERNAME }}
|
|
password: ${{ secrets.password }}
|
|
- name: Push tags
|
|
shell: bash
|
|
env:
|
|
DOCKER_IMAGE: ${{ vars.CONTAINER_REGISTRY }}/${{ gitea.repository }}
|
|
run: |
|
|
docker pull $DOCKER_IMAGE:main
|
|
docker tag $DOCKER_IMAGE:main $DOCKER_IMAGE:latest
|
|
docker tag $DOCKER_IMAGE:main $DOCKER_IMAGE:${{ steps.meta.outputs.version }}
|
|
docker push -a $DOCKER_IMAGE
|