|
|
|
|
@ -11,8 +11,22 @@ on:
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
build:
|
|
|
|
|
runs-on: ubuntu-24.04
|
|
|
|
|
timeout-minutes: 30
|
|
|
|
|
name: build ${{ matrix.arch }}
|
|
|
|
|
runs-on: ${{ matrix.runner }}
|
|
|
|
|
timeout-minutes: 90
|
|
|
|
|
strategy:
|
|
|
|
|
fail-fast: false
|
|
|
|
|
matrix:
|
|
|
|
|
include:
|
|
|
|
|
- platform: linux/amd64
|
|
|
|
|
runner: ubuntu-24.04
|
|
|
|
|
arch: amd64
|
|
|
|
|
- platform: linux/arm64
|
|
|
|
|
runner: ubuntu-24.04-arm
|
|
|
|
|
arch: arm64
|
|
|
|
|
|
|
|
|
|
env:
|
|
|
|
|
IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/docuseal-wl
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- name: Checkout code
|
|
|
|
|
@ -20,36 +34,82 @@ jobs:
|
|
|
|
|
with:
|
|
|
|
|
submodules: recursive
|
|
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
|
|
|
|
|
|
- name: Create .version file
|
|
|
|
|
run: echo ${{ github.ref_name }} > .version
|
|
|
|
|
|
|
|
|
|
- name: Login to Docker Hub
|
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
|
with:
|
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
|
|
|
|
|
- name: Build and push Docker image
|
|
|
|
|
id: build
|
|
|
|
|
uses: docker/build-push-action@v6
|
|
|
|
|
with:
|
|
|
|
|
context: .
|
|
|
|
|
platforms: ${{ matrix.platform }}
|
|
|
|
|
outputs: type=image,name=${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
|
|
|
|
|
cache-from: type=gha,scope=${{ matrix.arch }}
|
|
|
|
|
cache-to: type=gha,mode=max,scope=${{ matrix.arch }}
|
|
|
|
|
|
|
|
|
|
- name: Export digest
|
|
|
|
|
run: |
|
|
|
|
|
mkdir -p /tmp/digests
|
|
|
|
|
digest="${{ steps.build.outputs.digest }}"
|
|
|
|
|
touch "/tmp/digests/${digest#sha256:}"
|
|
|
|
|
|
|
|
|
|
- name: Upload digest
|
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
|
with:
|
|
|
|
|
name: digests-${{ matrix.arch }}
|
|
|
|
|
path: /tmp/digests/*
|
|
|
|
|
if-no-files-found: error
|
|
|
|
|
retention-days: 1
|
|
|
|
|
|
|
|
|
|
merge:
|
|
|
|
|
runs-on: ubuntu-24.04
|
|
|
|
|
timeout-minutes: 10
|
|
|
|
|
needs:
|
|
|
|
|
- build
|
|
|
|
|
|
|
|
|
|
env:
|
|
|
|
|
IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/docuseal-wl
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- name: Download digests
|
|
|
|
|
uses: actions/download-artifact@v4
|
|
|
|
|
with:
|
|
|
|
|
path: /tmp/digests
|
|
|
|
|
pattern: digests-*
|
|
|
|
|
merge-multiple: true
|
|
|
|
|
|
|
|
|
|
- name: Docker meta
|
|
|
|
|
id: meta
|
|
|
|
|
uses: docker/metadata-action@v5
|
|
|
|
|
with:
|
|
|
|
|
images: ${{ secrets.DOCKERHUB_USERNAME }}/docuseal-wl
|
|
|
|
|
images: ${{ env.IMAGE_NAME }}
|
|
|
|
|
tags: |
|
|
|
|
|
type=semver,pattern={{version}}
|
|
|
|
|
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
|
|
|
|
|
type=raw,value=latest,enable=${{ github.event_name == 'workflow_dispatch' }}
|
|
|
|
|
type=sha,prefix=sha-
|
|
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
|
|
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
|
|
|
|
|
|
- name: Create .version file
|
|
|
|
|
run: echo ${{ github.ref_name }} > .version
|
|
|
|
|
|
|
|
|
|
- name: Login to Docker Hub
|
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
|
with:
|
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
|
|
|
|
|
- name: Build and push Docker image
|
|
|
|
|
uses: docker/build-push-action@v6
|
|
|
|
|
with:
|
|
|
|
|
context: .
|
|
|
|
|
push: true
|
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
|
- name: Create multi-platform manifest
|
|
|
|
|
working-directory: /tmp/digests
|
|
|
|
|
run: |
|
|
|
|
|
docker buildx imagetools create \
|
|
|
|
|
$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
|
|
|
|
|
$(printf "${IMAGE_NAME}@sha256:%s " *)
|
|
|
|
|
|