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