Skip to content

Commit

Permalink
feat: migrate to multi-arch image
Browse files Browse the repository at this point in the history
BREAKING CHANGE: There is only a single image from now. Uses
nventiveux/ttrss only from now.
  • Loading branch information
BESANCON Vincent authored and bigbrozer committed Nov 25, 2021
1 parent f58101c commit 1e927d0
Show file tree
Hide file tree
Showing 15 changed files with 107 additions and 519 deletions.
43 changes: 21 additions & 22 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,37 @@ jobs:
lint:
name: "Linting"
runs-on: "ubuntu-20.04"
strategy:
matrix:
arch: ["amd64", "arm32v6"]

steps:
- uses: "actions/checkout@v2"

- name: "Lint Dockerfile: ${{ matrix.arch }}"
uses: "brpaz/hadolint-action@v1.4.0"
- name: "Lint Dockerfile"
uses: "hadolint/hadolint-action@v1.6.0"
with:
dockerfile: "Dockerfile.${{ matrix.arch }}"
dockerfile: "Dockerfile"

build:
name: "Build"
runs-on: "ubuntu-20.04"
strategy:
matrix:
arch: ["amd64", "arm32v6"]
env:
DOCKER_BUILDKIT: "1"

steps:
- uses: "actions/checkout@v2"

- name: "Build image: ${{ matrix.arch }}"
run: |
docker run \
--rm \
--privileged \
multiarch/qemu-user-static:register --reset
- name: "Set up QEMU"
uses: "docker/setup-qemu-action@v1"
with:
platforms: "amd64,arm64,arm"

curl -SLO https://github.com/multiarch/qemu-user-static/releases/download/v2.9.1-1/qemu-arm-static.tar.gz
tar zxvf qemu-arm-static.tar.gz
- name: "Set up Docker Buildx"
id: "buildx"
uses: "docker/setup-buildx-action@v1"
with:
install: true

docker build -f Dockerfile.${{ matrix.arch }} .
- name: "Build images"
uses: "docker/build-push-action@v2"
with:
builder: "${{ steps.buildx.outputs.name }}"
context: "."
file: "./Dockerfile"
platforms: "linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6"
push: false
tags: "latest"
52 changes: 0 additions & 52 deletions .github/workflows/release-amd64.yaml

This file was deleted.

60 changes: 0 additions & 60 deletions .github/workflows/release-arm32v6.yaml

This file was deleted.

67 changes: 67 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: "Release"

on:
push:
branches:
- "master"
- "develop"
schedule:
- cron: '0 10 * * 6'

jobs:
docker_image:
name: "Docker image"
runs-on: "ubuntu-20.04"
env:
IMAGE_NAME: "nventiveux/ttrss"

steps:
- uses: "actions/checkout@v2"

- name: "Set up QEMU"
uses: "docker/setup-qemu-action@v1"
with:
platforms: "amd64,arm64,arm"

- name: "Set up Docker Buildx"
id: "buildx"
uses: "docker/setup-buildx-action@v1"
with:
install: true

- name: "Prepare"
id: "prep"
run: |
branch_name="${GITHUB_REF#refs/heads/}"
calver="$(date +%Y.%m.%d)"
image_tags="${IMAGE_NAME}:${branch_name},${IMAGE_NAME}:${branch_name}-${calver}"
if [[ "${branch_name}" == "master" ]]; then
image_tags="${image_tags},${IMAGE_NAME}:latest"
fi
# Set outputs
echo ::set-output name=image_tags::${image_tags}
- name: "Login to DockerHub"
uses: "docker/login-action@v1"
with:
username: "${{ secrets.DOCKER_USERNAME }}"
password: "${{ secrets.DOCKER_PASSWORD }}"

- name: "Build images"
uses: "docker/build-push-action@v2"
with:
builder: "${{ steps.buildx.outputs.name }}"
context: "."
file: "./Dockerfile"
platforms: "linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6"
push: true
tags: "${{ steps.prep.outputs.image_tags }}"

- name: "Update Docker Hub's README"
uses: "peter-evans/dockerhub-description@v2"
with:
username: "${{ secrets.DOCKER_USERNAME }}"
password: "${{ secrets.DOCKER_PASSWORD }}"
repository: "${{ env.IMAGE_NAME }}"
File renamed without changes.
105 changes: 0 additions & 105 deletions Dockerfile.arm32v6

This file was deleted.

Loading

0 comments on commit 1e927d0

Please sign in to comment.