Publish OCI image to Forgejo as well as to DockerHub and remove unnecessary use of revision LABEL
All checks were successful
/ build (push) Successful in 1m34s

This commit is contained in:
Varakh 2024-11-19 12:59:35 +01:00
parent 04a5ba3a3d
commit dc5e2fa32b
3 changed files with 26 additions and 3 deletions

View file

@ -4,8 +4,9 @@ on:
- master - master
env: env:
FB_VERSION: 4.0.2 FB_VERSION: 4.0.2
REVISION: ${{ github.sha }}
IMAGE_TAG: varakh/filebin IMAGE_TAG: varakh/filebin
IMAGE_TAG_PRIVATE: git.myservermanager.com/varakh/filebin
FORGEJO_FQDN: git.myservermanager.com
VERSION_MAJOR: 4 VERSION_MAJOR: 4
VERSION_MINOR: 0 VERSION_MINOR: 0
VERSION_PATCH: 2 VERSION_PATCH: 2
@ -26,6 +27,13 @@ jobs:
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v2
- name: Login to Forgejo
uses: docker/login-action@v2
with:
registry: ${{ env.FORGEJO_FQDN }}
username: ${{ secrets.FORGEJO_USER }}
password: ${{ secrets.FORGEJO_TOKEN }}
- name: Login to Docker Hub - name: Login to Docker Hub
uses: docker/login-action@v2 uses: docker/login-action@v2
with: with:
@ -38,6 +46,10 @@ jobs:
build-args: FB_VERSION=${{ env.FB_VERSION }} build-args: FB_VERSION=${{ env.FB_VERSION }}
push: true push: true
tags: | tags: |
${{ env.IMAGE_TAG_PRIVATE }}:${{ env.VERSION_MAJOR }}
${{ env.IMAGE_TAG_PRIVATE }}:${{ env.VERSION_MAJOR }}.${{ env.VERSION_MINOR }}
${{ env.IMAGE_TAG_PRIVATE }}:${{ env.VERSION_MAJOR }}.${{ env.VERSION_MINOR }}.${{ env.VERSION_PATCH }}
${{ env.IMAGE_TAG_PRIVATE }}:latest
${{ env.IMAGE_TAG }}:${{ env.VERSION_MAJOR }} ${{ env.IMAGE_TAG }}:${{ env.VERSION_MAJOR }}
${{ env.IMAGE_TAG }}:${{ env.VERSION_MAJOR }}.${{ env.VERSION_MINOR }} ${{ env.IMAGE_TAG }}:${{ env.VERSION_MAJOR }}.${{ env.VERSION_MINOR }}
${{ env.IMAGE_TAG }}:${{ env.VERSION_MAJOR }}.${{ env.VERSION_MINOR }}.${{ env.VERSION_PATCH }} ${{ env.IMAGE_TAG }}:${{ env.VERSION_MAJOR }}.${{ env.VERSION_MINOR }}.${{ env.VERSION_PATCH }}

View file

@ -3,8 +3,9 @@ on:
- cron: '0 0 1 * *' - cron: '0 0 1 * *'
env: env:
FB_VERSION: 4.0.2 FB_VERSION: 4.0.2
REVISION: ${{ github.sha }}
IMAGE_TAG: varakh/filebin IMAGE_TAG: varakh/filebin
IMAGE_TAG_PRIVATE: git.myservermanager.com/varakh/filebin
FORGEJO_FQDN: git.myservermanager.com
VERSION_MAJOR: 4 VERSION_MAJOR: 4
VERSION_MINOR: 0 VERSION_MINOR: 0
VERSION_PATCH: 2 VERSION_PATCH: 2
@ -25,6 +26,13 @@ jobs:
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v2
- name: Login to Forgejo
uses: docker/login-action@v2
with:
registry: ${{ env.FORGEJO_FQDN }}
username: ${{ secrets.FORGEJO_USER }}
password: ${{ secrets.FORGEJO_TOKEN }}
- name: Login to Docker Hub - name: Login to Docker Hub
uses: docker/login-action@v2 uses: docker/login-action@v2
with: with:
@ -37,6 +45,10 @@ jobs:
build-args: FB_VERSION=${{ env.FB_VERSION }} build-args: FB_VERSION=${{ env.FB_VERSION }}
push: true push: true
tags: | tags: |
${{ env.IMAGE_TAG_PRIVATE }}:${{ env.VERSION_MAJOR }}
${{ env.IMAGE_TAG_PRIVATE }}:${{ env.VERSION_MAJOR }}.${{ env.VERSION_MINOR }}
${{ env.IMAGE_TAG_PRIVATE }}:${{ env.VERSION_MAJOR }}.${{ env.VERSION_MINOR }}.${{ env.VERSION_PATCH }}
${{ env.IMAGE_TAG_PRIVATE }}:latest
${{ env.IMAGE_TAG }}:${{ env.VERSION_MAJOR }} ${{ env.IMAGE_TAG }}:${{ env.VERSION_MAJOR }}
${{ env.IMAGE_TAG }}:${{ env.VERSION_MAJOR }}.${{ env.VERSION_MINOR }} ${{ env.IMAGE_TAG }}:${{ env.VERSION_MAJOR }}.${{ env.VERSION_MINOR }}
${{ env.IMAGE_TAG }}:${{ env.VERSION_MAJOR }}.${{ env.VERSION_MINOR }}.${{ env.VERSION_PATCH }} ${{ env.IMAGE_TAG }}:${{ env.VERSION_MAJOR }}.${{ env.VERSION_MINOR }}.${{ env.VERSION_PATCH }}

View file

@ -28,7 +28,6 @@ COPY --from=builder /app/fb_src /var/www
LABEL maintainer="Varakh <varakh@varakh.de>" \ LABEL maintainer="Varakh <varakh@varakh.de>" \
description="filebin" \ description="filebin" \
org.opencontainers.image.authors="Varakh" \ org.opencontainers.image.authors="Varakh" \
org.opencontainers.image.revision="${REVISION}" \
org.opencontainers.image.vendor="Varakh" \ org.opencontainers.image.vendor="Varakh" \
org.opencontainers.image.title="filebin" \ org.opencontainers.image.title="filebin" \
org.opencontainers.image.description="filebin" \ org.opencontainers.image.description="filebin" \