mirror of
https://github.com/tale/headplane.git
synced 2026-08-24 11:36:31 +00:00
feat: add matrix build for release
This commit is contained in:
@@ -70,7 +70,7 @@ jobs:
|
|||||||
build-args: |
|
build-args: |
|
||||||
IMAGE_TAG=ghcr.io/${{ github.repository }}:${{ matrix.tag }}
|
IMAGE_TAG=ghcr.io/${{ github.repository }}:${{ matrix.tag }}
|
||||||
secrets: |
|
secrets: |
|
||||||
MISE_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
|
gh_token=${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Attestation Provenance for ghcr.io/${{ github.repository }}:${{ matrix.tag }}
|
- name: Attestation Provenance for ghcr.io/${{ github.repository }}:${{ matrix.tag }}
|
||||||
uses: actions/attest-build-provenance@v2
|
uses: actions/attest-build-provenance@v2
|
||||||
|
|||||||
@@ -19,6 +19,14 @@ jobs:
|
|||||||
docker:
|
docker:
|
||||||
name: Docker Release
|
name: Docker Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- target: final
|
||||||
|
tag_suffix: ''
|
||||||
|
- target: debug-shell
|
||||||
|
tag_suffix: '-shell'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out the repo
|
- name: Check out the repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -30,6 +38,9 @@ jobs:
|
|||||||
images: ghcr.io/${{ github.repository }}
|
images: ghcr.io/${{ github.repository }}
|
||||||
tags: |
|
tags: |
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
|
flavor: |
|
||||||
|
latest=auto
|
||||||
|
suffix=${{ matrix.tag_suffix }},onlatest=true
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
@@ -44,19 +55,22 @@ jobs:
|
|||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
id: push
|
id: push
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
|
target: ${{ matrix.target }}
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
platforms: linux/amd64, linux/arm64
|
platforms: linux/amd64, linux/arm64
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
- name: Attestation Provenance
|
build-args: |
|
||||||
|
IMAGE_TAG=ghcr.io/${{ github.repository }}:${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
|
||||||
|
- name: Attestation Provenance for ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
|
||||||
uses: actions/attest-build-provenance@v2
|
uses: actions/attest-build-provenance@v2
|
||||||
id: attest
|
id: attest
|
||||||
with:
|
with:
|
||||||
|
|||||||
+1
-4
@@ -1,9 +1,6 @@
|
|||||||
FROM --platform=$BUILDPLATFORM jdxcode/mise:latest AS mise-context
|
FROM --platform=$BUILDPLATFORM jdxcode/mise:latest AS mise-context
|
||||||
COPY mise.toml .tool-versions ./
|
COPY mise.toml .tool-versions ./
|
||||||
|
RUN --mount=type=secret,id=gh_token,env=MISE_GITHUB_TOKEN mise install
|
||||||
ARG MISE_GITHUB_TOKEN
|
|
||||||
ENV MISE_GITHUB_TOKEN=${MISE_GITHUB_TOKEN:-}
|
|
||||||
RUN mise install
|
|
||||||
|
|
||||||
FROM --platform=$BUILDPLATFORM mise-context AS go-build
|
FROM --platform=$BUILDPLATFORM mise-context AS go-build
|
||||||
WORKDIR /build/
|
WORKDIR /build/
|
||||||
|
|||||||
Reference in New Issue
Block a user