89 lines
2.7 KiB
YAML
89 lines
2.7 KiB
YAML
name: LANCommander DockerHub
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
version_tag:
|
|
required: true
|
|
type: string
|
|
version_semver:
|
|
required: true
|
|
type: string
|
|
platform:
|
|
required: true
|
|
type: string
|
|
arch:
|
|
required: true
|
|
type: string
|
|
|
|
env:
|
|
REGISTRY: docker.io
|
|
IMAGE_NAME: lancommander/lancommander
|
|
|
|
permissions:
|
|
contents: write
|
|
packages: write
|
|
id-token: write
|
|
attestations: write
|
|
|
|
jobs:
|
|
build_server:
|
|
uses: ./.github/workflows/LANCommander.Server.yml
|
|
with:
|
|
version_semver: ${{ inputs.version_semver }}
|
|
version_tag: ${{ inputs.version_tag }}
|
|
build_runtime: ${{ inputs.platform }}-${{ inputs.arch }}
|
|
build_arch: ${{ inputs.arch }}
|
|
build_platform: Linux
|
|
|
|
push_to_registry:
|
|
needs: [build_server]
|
|
name: Push Docker image to Docker Hub
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Download Server Artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: LANCommander.Server-Linux-${{ inputs.arch }}-v${{ inputs.version_tag }}
|
|
path: ./Docker/build/${{ inputs.platform }}-${{ inputs.arch }}
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Setup buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
with:
|
|
platforms: ${{ inputs.platform }}/${{ inputs.arch }}
|
|
|
|
- name: Build and push Docker image
|
|
id: push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: ./Docker
|
|
file: ./Docker/Dockerfile
|
|
push: true
|
|
platforms: ${{ inputs.platform }}/${{ inputs.arch }}
|
|
tags: |
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.version_tag }}-${{ inputs.arch }}
|
|
labels: |
|
|
org.opencontainers.image.title=LANCommander Server
|
|
org.opencontainers.image.description="LANCommander Server Release Build"
|
|
org.opencontainers.image.version=${{ inputs.version_semver }}
|
|
org.opencontainers.image.revision=${{ github.sha }}
|
|
org.opencontainers.image.created=${{ github.event.created_at }}
|
|
org.opencontainers.image.architecture=${{ inputs.arch }}
|
|
build-args: |
|
|
VERSION=${{ inputs.version_tag }}
|
|
|
|
- name: Generate artifact attestation
|
|
uses: actions/attest-build-provenance@v2
|
|
with:
|
|
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:${{ inputs.version_tag }}-${{ inputs.arch }}
|
|
subject-digest: ${{ steps.push.outputs.digest }}
|
|
push-to-registry: true
|