Skip to content

Build Cache

Build Cache #46

Workflow file for this run

name: Build Cache
on:
push:
branches:
- master
schedule:
- cron: '0 1 * * *'
jobs:
build-cache:
runs-on: ubuntu-latest
strategy:
matrix:
component: [core]
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Get Cryptography Version
run: |
wget https://github.com/jumpserver/jumpserver/raw/master/pyproject.toml
cryptography_version=$(awk -F'"' '/cryptography/{print $2}' pyproject.toml)
echo "cryptography_version=${cryptography_version}" >> $GITHUB_ENV
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Image
uses: docker/build-push-action@v5
with:
context: .
file: ${{ matrix.component }}/Dockerfile.base
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x
push: true
build-args:
CRYPTOGRAPHY_VERSION=${{ env.cryptography_version }}
tags: |
${{ github.repository_owner }}/${{ matrix.component }}:base-bookworm
ghcr.io/${{ github.repository_owner }}/${{ matrix.component }}:base-bookworm
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
cache-from: type=gha
cache-to: type=gha,mode=max