2020-10-19 00:24:00 +02:00
|
|
|
name: Docker
|
2022-01-20 06:38:54 +01:00
|
|
|
permissions: read-all
|
2020-10-19 00:24:00 +02:00
|
|
|
on:
|
|
|
|
schedule:
|
2020-10-20 02:56:30 +02:00
|
|
|
- cron: '0 1 * * *'
|
2020-10-19 00:24:00 +02:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- '*.*.*'
|
|
|
|
jobs:
|
2020-10-29 05:18:07 +01:00
|
|
|
docker-images:
|
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
|
2020-10-29 05:18:07 +01:00
|
|
|
TAGS="${DOCKER_IMAGE}:${DOCKER_VERSION},ghcr.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/}
|
2020-10-29 05:18:07 +01:00
|
|
|
TAGS="${DOCKER_IMAGE}:${DOCKER_VERSION},ghcr.io/${DOCKER_IMAGE}:${DOCKER_VERSION},${DOCKER_IMAGE}:latest,ghcr.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
|
|
|
|
TAGS="${DOCKER_IMAGE}:${DOCKER_VERSION},ghcr.io/${DOCKER_IMAGE}:${DOCKER_VERSION}"
|
|
|
|
elif [[ $GITHUB_REF == refs/tags/* ]]; then
|
|
|
|
DOCKER_VERSION=${GITHUB_REF#refs/tags/}-distroless
|
|
|
|
TAGS="${DOCKER_IMAGE}:${DOCKER_VERSION},ghcr.io/${DOCKER_IMAGE}:${DOCKER_VERSION},${DOCKER_IMAGE}:latest-distroless,ghcr.io/${DOCKER_IMAGE}:latest-distroless"
|
|
|
|
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
|
2022-08-12 06:18:35 +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
|
2022-08-12 06:18:35 +02:00
|
|
|
uses: docker/login-action@v2
|
2020-10-29 05:18:07 +01:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.CR_PAT }}
|
|
|
|
|
2022-03-16 06:39:16 +01:00
|
|
|
- name: Build and Push Alpine images
|
2022-08-12 06:19:07 +02:00
|
|
|
uses: docker/build-push-action@v3
|
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
|
2022-08-12 06:19:07 +02:00
|
|
|
uses: docker/build-push-action@v3
|
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 }}
|