Skip to content

Commit

Permalink
ci: fix build-and-push workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
antmelekhin committed Dec 4, 2023
1 parent 23de11f commit 8a0338e
Showing 1 changed file with 24 additions and 27 deletions.
51 changes: 24 additions & 27 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
name: 'Build docker images'
on:
pull_request:
paths:
- '**.Dockerfile'
- '.github/workflows/build-and-push.yml'
push:
branches:
- main
paths:
- '**.Dockerfile'
- '.github/workflows/build-and-push.yml'
schedule:
- cron: '0 1 * * 0'

Expand All @@ -14,42 +20,33 @@ jobs:
strategy:
matrix:
include:
- name: 'centos-7'
- tag: 'amazonlinux-2023'
dockerfile: 'amazonlinux/2023.Dockerfile'
platforms: linux/amd64,linux/arm64
- tag: 'centos-7'
dockerfile: 'centos/7.Dockerfile'
platforms: linux/amd64
tags: 'antmelekhin/docker-systemd:centos-7'
- name: 'debian-10'
- tag: 'debian-10'
dockerfile: 'debian/10.Dockerfile'
platforms: linux/amd64,linux/arm64
tags: 'antmelekhin/docker-systemd:debian-10'
- name: 'debian-11'
- tag: 'debian-11'
dockerfile: 'debian/11.Dockerfile'
platforms: linux/amd64,linux/arm64
tags: 'antmelekhin/docker-systemd:debian-11'
- name: 'debian-12'
- tag: 'debian-12'
dockerfile: 'debian/12.Dockerfile'
platforms: linux/amd64,linux/arm64
tags: 'antmelekhin/docker-systemd:debian-12'
- name: 'ubuntu-20.04'
dockerfile: 'ubuntu/20.04.Dockerfile'
platforms: linux/amd64,linux/arm64
tags: 'antmelekhin/docker-systemd:ubuntu-20.04'
- name: 'ubuntu-22.04'
dockerfile: 'ubuntu/22.04.Dockerfile'
platforms: linux/amd64,linux/arm64
tags: 'antmelekhin/docker-systemd:ubuntu-22.04'
- name: 'rockylinux-8'
- tag: 'rockylinux-8'
dockerfile: 'rockylinux/8.Dockerfile'
platforms: linux/amd64,linux/arm64
tags: 'antmelekhin/docker-systemd:rockylinux-8'
- name: 'rockylinux-9'
- tag: 'rockylinux-9'
dockerfile: 'rockylinux/9.Dockerfile'
platforms: linux/amd64,linux/arm64
tags: 'antmelekhin/docker-systemd:rockylinux-9'
- name: 'amazonlinux-2023'
dockerfile: 'amazonlinux/2023.Dockerfile'
- tag: 'ubuntu-20.04'
dockerfile: 'ubuntu/20.04.Dockerfile'
platforms: linux/amd64,linux/arm64
- tag: 'ubuntu-22.04'
dockerfile: 'ubuntu/22.04.Dockerfile'
platforms: linux/amd64,linux/arm64
tags: 'antmelekhin/docker-systemd:amazonlinux-2023'

steps:
- name: 'Checkout the codebase'
Expand All @@ -67,11 +64,11 @@ jobs:
username: 'antmelekhin'
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: 'Build and push ${{ matrix.name }}'
- name: 'Build and push ${{ matrix.tag }}'
uses: docker/build-push-action@v4
with:
context: .
file: ${{ matrix.dockerfile }}
platforms: ${{ matrix.platforms }}
file: '${{ matrix.dockerfile }}'
platforms: '${{ matrix.platforms }}'
push: true
tags: ${{ matrix.tags }}
tags: 'antmelekhin/docker-systemd:${{ matrix.tag }}'

0 comments on commit 8a0338e

Please sign in to comment.