redsunlib/.github/workflows/main-docker.yml

60 lines
1.6 KiB
YAML
Raw Normal View History

2023-06-01 11:47:58 +12:00
name: Docker Build
on:
push:
paths-ignore:
- "**.md"
branches:
2023-06-01 11:47:58 +12:00
- 'main'
jobs:
build-docker:
runs-on: ubuntu-latest
2023-06-01 11:47:58 +12:00
strategy:
matrix:
config:
- { platform: 'linux/amd64', tag: 'latest', dockerfile: 'Dockerfile' }
- { platform: 'linux/arm64', tag: 'latest-arm', dockerfile: 'Dockerfile.arm' }
- { platform: 'linux/arm/v7', tag: 'latest-armv7', dockerfile: 'Dockerfile.armv7' }
steps:
2023-06-01 11:47:58 +12:00
- name: Checkout sources
uses: actions/checkout@v3
- name: Set up QEMU
2023-06-01 11:47:58 +12:00
uses: docker/setup-qemu-action@v2
with:
platforms: all
2023-06-01 11:47:58 +12:00
- name: Set up Docker Buildx
id: buildx
2023-06-01 11:47:58 +12:00
uses: docker/setup-buildx-action@v2
with:
version: latest
2023-06-01 11:47:58 +12:00
2023-12-27 12:25:52 +13:00
- name: Login to Quay.io
uses: docker/login-action@v3
with:
2023-12-27 12:25:52 +13:00
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
2023-06-01 11:47:58 +12:00
2023-12-27 12:25:52 +13:00
- name: push README to Quay.io
uses: christian-korneck/update-container-description-action@v1
env:
DOCKER_APIKEY: ${{ secrets.APIKEY__QUAY_IO }}
with:
2023-12-27 12:25:52 +13:00
destination_container_repo: quay.io/redlib/redlib
provider: quay
readme_file: 'README.md'
2023-06-01 11:47:58 +12:00
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
2023-06-01 11:47:58 +12:00
file: ./${{ matrix.config.dockerfile }}
platforms: ${{ matrix.config.platform }}
push: true
2023-12-27 13:09:54 +13:00
tags: quay.io/redlib/redlib:${{ matrix.config.tag }}
2022-05-16 09:37:13 +12:00
cache-from: type=gha
cache-to: type=gha,mode=max