mirror of
https://github.com/napnap75/multiarch-docker-images.git
synced 2025-12-15 11:14:19 +01:00
43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
name: CI to Docker Hub
|
|
|
|
on: [push, pull_request, workflow_dispatch]
|
|
|
|
jobs:
|
|
multi:
|
|
env:
|
|
BUILD_PLATFORMS: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
repository: [restic-auto]
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Load specific environment
|
|
run: if [ -f ${{ matrix.repository }}/.build-env ] ; then cat ${{ matrix.repository }}/.build-env >> $GITHUB_ENV ; fi
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: ${{ matrix.repository }}/
|
|
file: ${{ matrix.repository }}/Dockerfile
|
|
platforms: ${{ env.BUILD_PLATFORMS }}
|
|
push: true
|
|
tags: |
|
|
${{ secrets.DOCKER_HUB_USERNAME }}/${{ matrix.repository }}:latest
|