tags: ${{ steps.docker.outputs.tags }}

This commit is contained in:
miwr 2025-04-08 10:16:17 +02:00
parent 4ce1d0f658
commit 2a7f1314c4

View file

@ -10,20 +10,27 @@ jobs:
contents: read contents: read
steps: steps:
- name: Checkout Repository - name: Repository meta
uses: actions/checkout@v3 id: repository
run: |
- name: Set up Docker Buildx registry=${{ github.server_url }}
id: buildx registry=${registry##http*://}
uses: docker/setup-buildx-action@v3 echo "registry=${registry}" >> "$GITHUB_OUTPUT"
echo "registry=${registry}"
- name: Docker Login to Forgejo Registry repository="$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')"
echo "repository=${repository}" >> "$GITHUB_OUTPUT"
echo "repository=${repository}"
- name: Docker meta
uses: docker/metadata-action@v5
id: docker
with:
images: ${{ steps.repository.outputs.registry }}/${{ steps.repository.outputs.repository }}
- name: Login to registry
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
registry: ${{ forgejo.instance_url }}/packages/${{ github.repository_owner }}/${{ github.repository }} registry: ${{ steps.repository.outputs.registry }}
username: ${{ github.repository_owner }} username: ${{ secrets.PACKAGES_USER }}
password: ${{ secrets.FORGEJO_PACKAGE_REGISTRY_TOKEN }} password: ${{ secrets.PACKAGES_TOKEN }}
- name: Build and Push Docker Image - name: Build and Push Docker Image
id: docker_build_push id: docker_build_push
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
@ -31,7 +38,7 @@ jobs:
context: . context: .
file: Dockerfile file: Dockerfile
push: true push: true
tags: ${{ forgejo.instance_url }}/packages/${{ github.repository_owner }}/${{ github.repository }}:${{ github.sha }} tags: ${{ steps.docker.outputs.tags }}
labels: | labels: |
org.opencontainers.image.title=${{ github.repository }} org.opencontainers.image.title=${{ github.repository }}
org.opencontainers.image.version=${{ github.sha }} org.opencontainers.image.version=${{ github.sha }}