2023-06-01 11:47:58 +12:00
|
|
|
name: Docker Build
|
2021-08-05 07:08:25 +12:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- "**.md"
|
|
|
|
branches:
|
2023-06-01 11:47:58 +12:00
|
|
|
- 'main'
|
|
|
|
- 'master'
|
2021-08-05 07:08:25 +12:00
|
|
|
|
|
|
|
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' }
|
2021-08-05 07:08:25 +12:00
|
|
|
steps:
|
2023-06-01 11:47:58 +12:00
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2021-08-05 07:08:25 +12:00
|
|
|
- name: Set up QEMU
|
2023-06-01 11:47:58 +12:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2021-08-05 07:08:25 +12:00
|
|
|
with:
|
|
|
|
platforms: all
|
2023-06-01 11:47:58 +12:00
|
|
|
|
2021-08-05 07:08:25 +12:00
|
|
|
- name: Set up Docker Buildx
|
|
|
|
id: buildx
|
2023-06-01 11:47:58 +12:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2021-08-05 07:08:25 +12:00
|
|
|
with:
|
|
|
|
version: latest
|
2023-06-01 11:47:58 +12:00
|
|
|
|
2021-08-05 07:08:25 +12:00
|
|
|
- name: Login to DockerHub
|
2023-06-01 11:47:58 +12:00
|
|
|
uses: docker/login-action@v2
|
2021-08-05 07:08:25 +12:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
2023-06-01 11:47:58 +12:00
|
|
|
|
2022-12-05 08:01:28 +13:00
|
|
|
- name: Docker Hub Description
|
|
|
|
uses: peter-evans/dockerhub-description@v3
|
2023-06-01 11:47:58 +12:00
|
|
|
if: matrix.config.platform == 'linux/amd64'
|
2022-12-05 08:01:28 +13:00
|
|
|
with:
|
2022-12-05 08:07:18 +13:00
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
2022-12-05 08:01:28 +13:00
|
|
|
repository: libreddit/libreddit
|
2023-06-01 11:47:58 +12:00
|
|
|
|
2021-08-05 07:08:25 +12:00
|
|
|
- name: Build and push
|
2023-06-01 11:47:58 +12:00
|
|
|
uses: docker/build-push-action@v4
|
2021-08-05 07:08:25 +12:00
|
|
|
with:
|
|
|
|
context: .
|
2023-06-01 11:47:58 +12:00
|
|
|
file: ./${{ matrix.config.dockerfile }}
|
|
|
|
platforms: ${{ matrix.config.platform }}
|
2021-08-05 07:08:25 +12:00
|
|
|
push: true
|
2023-06-01 11:47:58 +12:00
|
|
|
tags: libreddit/libreddit:${{ matrix.config.tag }}
|
2022-05-16 09:37:13 +12:00
|
|
|
cache-from: type=gha
|
|
|
|
cache-to: type=gha,mode=max
|