2022-05-05 00:13:32 +02:00
|
|
|
name: Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- "*"
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "v[0-9].*.*"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Build image
|
|
|
|
steps:
|
|
|
|
- name: 📥 Checkout the repository
|
2023-09-07 06:23:42 +02:00
|
|
|
uses: actions/checkout@v4
|
2022-05-05 00:13:32 +02:00
|
|
|
|
|
|
|
- name: 🏗 Set up QEMU
|
2023-09-14 14:51:57 +02:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2022-05-05 00:13:32 +02:00
|
|
|
|
|
|
|
- name: 🏗 Set up Docker Buildx
|
2023-09-14 14:52:05 +02:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2022-05-05 00:13:32 +02:00
|
|
|
|
|
|
|
- name: 🪄 Extract metadata (tags, labels)
|
|
|
|
id: meta
|
2023-09-14 14:52:15 +02:00
|
|
|
uses: docker/metadata-action@v5
|
2022-05-05 00:13:32 +02:00
|
|
|
with:
|
|
|
|
images: |
|
|
|
|
ghcr.io/${{ github.repository }}
|
|
|
|
tags: |
|
|
|
|
type=ref,event=pr
|
|
|
|
type=semver,pattern=v{{version}}
|
|
|
|
type=semver,pattern=v{{major}}.{{minor}}
|
|
|
|
type=semver,pattern=v{{major}}
|
|
|
|
|
|
|
|
- name: 🔓 Registry login
|
|
|
|
if: github.event_name == 'push'
|
2024-03-13 19:24:41 +01:00
|
|
|
uses: docker/login-action@v3.1.0
|
2022-05-05 00:13:32 +02:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: 🛠️ Build image
|
2023-09-14 14:52:31 +02:00
|
|
|
uses: docker/build-push-action@v5
|
2022-05-05 00:13:32 +02:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./Dockerfile
|
|
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
push: ${{ github.event_name == 'push' }}
|