mirror of
https://github.com/chevereto/docker.git
synced 2026-02-23 14:40:43 +01:00
build
This commit is contained in:
71
.github/workflows/docker.yml
vendored
Normal file
71
.github/workflows/docker.yml
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
name: Docker
|
||||
|
||||
on: [create, workflow_dispatch]
|
||||
|
||||
env:
|
||||
GHCR_SLUG: ghcr.io/${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
php: ["8.1"]
|
||||
name: Build on PHP ${{ matrix.php }} ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v3
|
||||
with:
|
||||
flavor: |
|
||||
suffix=-php${{ matrix.php }}
|
||||
images: |
|
||||
${{ env.GHCR_SLUG }}
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
labels: |
|
||||
org.opencontainers.image.title=Chevereto V4
|
||||
org.opencontainers.image.description=Chevereto V4
|
||||
org.opencontainers.image.vendor=Chevereto
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Prepare Dockerfile
|
||||
run: cp ./chevereto/Dockerfile .
|
||||
|
||||
- name: Build
|
||||
uses: docker/bake-action@v1
|
||||
with:
|
||||
set: build.args.PHP=${{ matrix.php }}
|
||||
files: |
|
||||
./docker-bake.hcl
|
||||
${{ steps.meta.outputs.bake-file }}
|
||||
targets: build
|
||||
push: true
|
||||
|
||||
- name: Check manifest
|
||||
run: |
|
||||
docker buildx imagetools inspect ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }}
|
||||
|
||||
- name: Inspect image
|
||||
run: |
|
||||
docker pull ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }}
|
||||
docker image inspect ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }}
|
||||
Reference in New Issue
Block a user