Files
FreshRSS/.github/workflows/docker-publish.yml
dependabot[bot] 292b19c950 Bump docker/metadata-action from 5 to 6 (#8757)
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 5 to 6.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](https://github.com/docker/metadata-action/compare/v5...v6)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-02 11:22:54 +02:00

96 lines
3.1 KiB
YAML

name: Publish Docker images
on:
push:
branches:
- edge
release:
types: [published]
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
build-container-image:
name: Build Docker image ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: Debian
file: Docker/Dockerfile
flavor: |
latest=auto
tags: |
type=edge,onlatest=false
type=semver,pattern={{version}}
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/0.') }}
# type=semver,pattern={{major}}.{{minor}}
- name: Alpine
file: Docker/Dockerfile-Alpine
flavor: |
latest=false
tags: |
type=raw,value=alpine,enable=${{ github.ref == 'refs/heads/latest' || startsWith(github.ref, 'refs/tags/') }}
type=edge,suffix=-alpine,onlatest=false
type=semver,pattern={{version}}-alpine
type=semver,pattern={{major}}-alpine,enable=${{ !startsWith(github.ref, 'refs/tags/0.') }}
# type=semver,pattern={{major}}.{{minor}}-alpine
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Checkout
uses: actions/checkout@v6
- name: Get FreshRSS version
run: |
FRESHRSS_VERSION=$(sed -n "s/^const FRESHRSS_VERSION = '\(.*\)'.*$/\1/p" constants.php)
echo "$FRESHRSS_VERSION"
echo "FRESHRSS_VERSION=$FRESHRSS_VERSION" >> $GITHUB_ENV
- name: Add metadata to Docker images
id: meta
uses: docker/metadata-action@v6
with:
flavor: ${{ matrix.flavor }}
images: |
docker.io/freshrss/freshrss
ghcr.io/${{ github.repository }}
tags: ${{ matrix.tags }}
labels: |
org.opencontainers.image.url=https://freshrss.org/
org.opencontainers.image.version=${{ env.FRESHRSS_VERSION }}
- name: Login to Docker Hub
if: github.repository_owner == 'FreshRSS'
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
if: github.repository_owner == 'FreshRSS'
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v7
with:
file: ${{ matrix.file }}
platforms: linux/amd64,linux/arm/v7,linux/arm64
build-args: |
FRESHRSS_VERSION=${{ env.FRESHRSS_VERSION }}
SOURCE_COMMIT=${{ github.sha }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: ${{ (github.ref == 'refs/heads/latest' || github.ref == 'refs/heads/edge' || startsWith(github.ref, 'refs/tags/')) && github.repository_owner == 'FreshRSS' }}