2023-01-21 22:51:18 +00:00
|
|
|
name: build & push docker container
|
2023-01-21 22:41:17 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
tags:
|
|
|
|
- '*'
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
jobs:
|
|
|
|
docker:
|
|
|
|
runs-on: ubuntu-latest
|
2023-01-21 22:51:18 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: write
|
2023-01-21 22:41:17 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-11-29 17:54:45 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-01-21 22:41:17 +00:00
|
|
|
- name: Docker meta
|
|
|
|
id: metal
|
2024-01-10 15:02:29 +00:00
|
|
|
uses: docker/metadata-action@v5
|
2023-01-21 22:41:17 +00:00
|
|
|
with:
|
|
|
|
images: |
|
2023-05-21 16:29:29 +00:00
|
|
|
ghcr.io/${{ github.repository }}
|
2023-01-21 22:41:17 +00:00
|
|
|
- name: Set up QEMU
|
2024-01-15 08:35:52 +00:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2023-01-21 22:41:17 +00:00
|
|
|
- name: Set up Docker Buildx
|
2024-01-10 13:46:05 +00:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-01-21 22:41:17 +00:00
|
|
|
- name: Login to GitHub Container Registry
|
|
|
|
if: github.event_name != 'pull_request'
|
2024-01-10 14:01:10 +00:00
|
|
|
uses: docker/login-action@v3
|
2023-01-21 22:41:17 +00:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
2023-05-21 16:29:29 +00:00
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ github.token }}
|
2023-01-21 22:41:17 +00:00
|
|
|
- name: Build and push
|
2023-11-29 17:54:13 +00:00
|
|
|
uses: docker/build-push-action@v5
|
2023-01-21 22:41:17 +00:00
|
|
|
with:
|
|
|
|
context: .
|
2024-03-17 15:15:04 +00:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2023-01-21 22:41:17 +00:00
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
|
|
tags: ${{ steps.metal.outputs.tags }}
|
|
|
|
labels: ${{ steps.metal.outputs.labels }}
|
|
|
|
cache-from: type=gha
|
|
|
|
cache-to: type=gha,mode=max
|