mirror of
https://github.com/zhboner/realm.git
synced 2026-11-17 08:15:55 +00:00
68 lines
1.9 KiB
YAML
68 lines
1.9 KiB
YAML
name: docker
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
required: true
|
|
default: "test"
|
|
push:
|
|
paths-ignore: ["**.md"]
|
|
branches: [master]
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
# build amd64/arm64 binaries
|
|
- run: mkdir -p out/x86_64-unknown-linux-musl out/aarch64-unknown-linux-musl
|
|
- name: build amd64
|
|
uses: ./.github/actions/build/cross
|
|
with:
|
|
target: x86_64-unknown-linux-musl
|
|
outdir: out/x86_64-unknown-linux-musl
|
|
- name: build arm64
|
|
uses: ./.github/actions/build/cross
|
|
with:
|
|
target: aarch64-unknown-linux-musl
|
|
outdir: out/aarch64-unknown-linux-musl
|
|
|
|
- name: setup buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: login to GitHub registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# build and push
|
|
- name: fetch metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ghcr.io/${{ github.repository_owner }}/realm2
|
|
- name: build and push images
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
push: true
|
|
|
|
# build and push (slim)
|
|
- name: fetch metadata
|
|
id: meta_slim
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ghcr.io/${{ github.repository_owner }}/realm2-slim
|
|
- name: build and push images
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64
|
|
tags: ${{ steps.meta_slim.outputs.tags }}
|
|
build-args: |
|
|
BINARY_NAME=realm-slim
|
|
push: true
|