actions/docker/action.yaml

34 lines
1010 B
YAML
Raw Normal View History

2024-08-03 10:12:03 +00:00
name: Docker deploy
description: Deploy docker image to Gitea
2024-08-01 20:08:21 +00:00
inputs:
registry:
description: "Server address of Docker registry."
2024-08-02 11:07:09 +00:00
default: ${{ vars.CONTAINER_REGISTRY }}
2024-08-01 20:37:53 +00:00
username:
description: "Username used to log against the Docker registry"
default: ${{ vars.CONTAINER_REGISTRY_USERNAME }}
password:
description: "Password or personal access token used to log against the Docker registry"
required: true
2024-08-01 20:08:21 +00:00
runs:
using: composite
steps:
- uses: docker/metadata-action@v5
id: meta
with:
2024-08-01 20:13:35 +00:00
images: ${{ inputs.registry }}/${{ gitea.repository }}
2024-08-01 20:08:21 +00:00
- uses: docker/login-action@v3
with:
2024-08-01 20:13:35 +00:00
registry: ${{ inputs.registry }}
2024-08-01 20:37:53 +00:00
username: ${{ inputs.username }}
password: ${{ inputs.password }}
2024-08-01 20:08:21 +00:00
- uses: docker/build-push-action@v6
2024-08-14 15:37:55 +00:00
if: ${{ !startsWith(gitea.ref, 'refs/tags/v') }}
2024-08-01 20:08:21 +00:00
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}