87 lines
2.2 KiB
YAML
87 lines
2.2 KiB
YAML
name: Images
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- "image/**"
|
|
- "*image"
|
|
- "image*"
|
|
paths-ignore:
|
|
- .github/workflows/ci.yml
|
|
- .github/workflows/lock.yml
|
|
- ".github/ISSUE_TEMPLATE/**"
|
|
- "docs/**"
|
|
- "hack/**"
|
|
- "**.md"
|
|
- ".gitignore"
|
|
- "Makefile"
|
|
|
|
jobs:
|
|
build-test:
|
|
if: github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/')
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
name: Build
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- dockerfile: Dockerfile
|
|
- dockerfile: Dockerfile.debian
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Build
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
file: ${{ matrix.dockerfile }}
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
build:
|
|
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
name: Build and Publish
|
|
env:
|
|
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USER }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Docker Environment
|
|
id: vars
|
|
uses: ./.github/actions/setup-docker-environment
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and Push
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
file: Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: |
|
|
ghcr.io/${{ github.repository }}:${{ steps.vars.outputs.tag }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
|
|
- name: Build and Push (debian stable-slim)
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
file: Dockerfile.debian
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: |
|
|
ghcr.io/${{ github.repository }}-debian-stable-slim:${{ steps.vars.outputs.tag }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|