2020-10-19 00:24:00 +02:00
|
|
|
name: Docker
|
|
|
|
on:
|
|
|
|
schedule:
|
2020-10-20 02:56:30 +02:00
|
|
|
- cron: '0 1 * * *'
|
2020-10-19 00:24:00 +02:00
|
|
|
push:
|
|
|
|
tags:
|
2023-07-27 05:42:08 +02:00
|
|
|
- '[0-9]+.[0-9]+.[0-9]+'
|
2023-06-23 05:54:30 +02:00
|
|
|
pull_request:
|
|
|
|
branches: [ main ]
|
2020-10-19 00:24:00 +02:00
|
|
|
jobs:
|
2023-06-23 05:54:30 +02:00
|
|
|
test-docker-images:
|
|
|
|
if: github.event.pull_request
|
2023-08-10 05:26:57 +02:00
|
|
|
name: Test Images
|
2023-06-23 05:54:30 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Build Alpine image
|
|
|
|
uses: docker/build-push-action@v4
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./packaging/docker/alpine/Dockerfile
|
|
|
|
push: false
|
|
|
|
tags: ${{ github.repository_owner }}/miniflux:alpine-dev
|
|
|
|
- name: Test Alpine Docker image
|
|
|
|
run: docker run --rm ${{ github.repository_owner }}/miniflux:alpine-dev miniflux -i
|
|
|
|
- name: Build Distroless image
|
|
|
|
uses: docker/build-push-action@v4
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./packaging/docker/distroless/Dockerfile
|
|
|
|
push: false
|
|
|
|
tags: ${{ github.repository_owner }}/miniflux:distroless-dev
|
|
|
|
- name: Test Distroless Docker image
|
|
|
|
run: docker run --rm ${{ github.repository_owner }}/miniflux:distroless-dev miniflux -i
|
|
|
|
|
|
|
|
publish-docker-images:
|
|
|
|
if: ${{ ! github.event.pull_request }}
|
2023-08-10 05:26:57 +02:00
|
|
|
name: Publish Images
|
2023-03-28 06:21:07 +02:00
|
|
|
permissions:
|
|
|
|
packages: write
|
2020-10-19 00:24:00 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-08-09 07:07:07 +02:00
|
|
|
uses: actions/checkout@v3
|
2020-10-20 05:25:15 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2020-10-19 00:24:00 +02:00
|
|
|
|
2022-03-16 06:39:16 +01:00
|
|
|
- name: Generate Alpine Docker tag
|
|
|
|
id: docker_alpine_tag
|
2020-10-20 02:56:30 +02:00
|
|
|
run: |
|
2022-04-27 10:25:42 +02:00
|
|
|
DOCKER_IMAGE=${{ github.repository_owner }}/miniflux
|
2020-10-20 02:56:30 +02:00
|
|
|
DOCKER_VERSION=dev
|
|
|
|
if [ "${{ github.event_name }}" = "schedule" ]; then
|
|
|
|
DOCKER_VERSION=nightly
|
2023-03-20 05:16:46 +01:00
|
|
|
TAGS="docker.io/${DOCKER_IMAGE}:${DOCKER_VERSION},ghcr.io/${DOCKER_IMAGE}:${DOCKER_VERSION},quay.io/${DOCKER_IMAGE}:${DOCKER_VERSION}"
|
2020-10-20 02:56:30 +02:00
|
|
|
elif [[ $GITHUB_REF == refs/tags/* ]]; then
|
|
|
|
DOCKER_VERSION=${GITHUB_REF#refs/tags/}
|
2023-03-20 05:16:46 +01:00
|
|
|
TAGS="docker.io/${DOCKER_IMAGE}:${DOCKER_VERSION},ghcr.io/${DOCKER_IMAGE}:${DOCKER_VERSION},quay.io/${DOCKER_IMAGE}:${DOCKER_VERSION},docker.io/${DOCKER_IMAGE}:latest,ghcr.io/${DOCKER_IMAGE}:latest,quay.io/${DOCKER_IMAGE}:latest"
|
2020-10-20 02:56:30 +02:00
|
|
|
fi
|
|
|
|
echo ::set-output name=tags::${TAGS}
|
|
|
|
|
2022-03-16 06:39:16 +01:00
|
|
|
- name: Generate Distroless Docker tag
|
|
|
|
id: docker_distroless_tag
|
|
|
|
run: |
|
2022-04-27 10:25:42 +02:00
|
|
|
DOCKER_IMAGE=${{ github.repository_owner }}/miniflux
|
2022-03-16 06:39:16 +01:00
|
|
|
DOCKER_VERSION=dev-distroless
|
|
|
|
if [ "${{ github.event_name }}" = "schedule" ]; then
|
|
|
|
DOCKER_VERSION=nightly-distroless
|
2023-03-20 05:16:46 +01:00
|
|
|
TAGS="docker.io/${DOCKER_IMAGE}:${DOCKER_VERSION},ghcr.io/${DOCKER_IMAGE}:${DOCKER_VERSION},quay.io/${DOCKER_IMAGE}:${DOCKER_VERSION}"
|
2022-03-16 06:39:16 +01:00
|
|
|
elif [[ $GITHUB_REF == refs/tags/* ]]; then
|
|
|
|
DOCKER_VERSION=${GITHUB_REF#refs/tags/}-distroless
|
2023-03-20 05:16:46 +01:00
|
|
|
TAGS="docker.io/${DOCKER_IMAGE}:${DOCKER_VERSION},ghcr.io/${DOCKER_IMAGE}:${DOCKER_VERSION},quay.io/${DOCKER_IMAGE}:${DOCKER_VERSION},docker.io/${DOCKER_IMAGE}:latest-distroless,ghcr.io/${DOCKER_IMAGE}:latest-distroless,quay.io/${DOCKER_IMAGE}:latest-distroless"
|
2022-03-16 06:39:16 +01:00
|
|
|
fi
|
|
|
|
echo ::set-output name=tags::${TAGS}
|
|
|
|
|
2020-10-19 00:24:00 +02:00
|
|
|
- name: Set up QEMU
|
2022-08-09 07:07:04 +02:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2020-10-19 00:24:00 +02:00
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
2022-08-09 07:19:58 +02:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2020-10-19 00:24:00 +02:00
|
|
|
|
|
|
|
- name: Login to DockerHub
|
2023-07-27 05:42:08 +02:00
|
|
|
uses: docker/login-action@v2
|
2020-10-19 00:24:00 +02:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
2020-10-29 05:18:07 +01:00
|
|
|
- name: Login to GitHub Container Registry
|
2023-07-27 05:42:08 +02:00
|
|
|
uses: docker/login-action@v2
|
2020-10-29 05:18:07 +01:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
2023-03-28 06:21:07 +02:00
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2020-10-29 05:18:07 +01:00
|
|
|
|
2023-03-20 05:16:46 +01:00
|
|
|
- name: Login to Quay Container Registry
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
registry: quay.io
|
|
|
|
username: ${{ secrets.QUAY_USERNAME }}
|
|
|
|
password: ${{ secrets.QUAY_TOKEN }}
|
|
|
|
|
2022-03-16 06:39:16 +01:00
|
|
|
- name: Build and Push Alpine images
|
2023-01-30 23:08:25 +01:00
|
|
|
uses: docker/build-push-action@v4
|
2020-10-19 00:24:00 +02:00
|
|
|
with:
|
|
|
|
context: .
|
2022-03-16 06:39:16 +01:00
|
|
|
file: ./packaging/docker/alpine/Dockerfile
|
2020-10-19 00:24:00 +02:00
|
|
|
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
|
|
|
|
push: true
|
2022-03-16 06:39:16 +01:00
|
|
|
tags: ${{ steps.docker_alpine_tag.outputs.tags }}
|
|
|
|
|
|
|
|
- name: Build and Push Distroless images
|
2023-01-30 23:08:25 +01:00
|
|
|
uses: docker/build-push-action@v4
|
2022-03-16 06:39:16 +01:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./packaging/docker/distroless/Dockerfile
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
push: true
|
|
|
|
tags: ${{ steps.docker_distroless_tag.outputs.tags }}
|