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
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: 🏗 Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
|
|
|
|
- name: 🏗 Set up Docker Buildx
|
2022-05-05 23:32:17 +02:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2022-05-05 00:13:32 +02:00
|
|
|
|
|
|
|
- name: 🪄 Extract metadata (tags, labels)
|
|
|
|
id: meta
|
2022-05-05 23:31:44 +02:00
|
|
|
uses: docker/metadata-action@v4
|
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'
|
2022-05-05 23:32:07 +02:00
|
|
|
uses: docker/login-action@v2.0.0
|
2022-05-05 00:13:32 +02:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: 🛠️ Build image
|
2022-05-05 23:31:58 +02:00
|
|
|
uses: docker/build-push-action@v3
|
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' }}
|