2024-09-12 19:09:03 +02:00
name : Dependencies builds
on :
push :
branches : [ master]
pull_request :
branches : [ master]
schedule :
# At 23:18 every Wednesday, 2 hours before `photoview`. Details in https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule
- cron : '18 23 * * 3'
env :
IS_PUSHING_IMAGES : ${{ github.event_name != 'pull_request' && github.repository == 'photoview/photoview' }}
2024-09-13 11:44:30 +02:00
IS_CACHING : ${{ github.event_name == 'pull_request' }}
2024-09-12 19:09:03 +02:00
DOCKER_USERNAME : viktorstrate
DOCKER_IMAGE : viktorstrate/dependencies
DOCKER_PASSWORD : ${{ secrets.DOCKER_PASSWORD }}
PLATFORMS : linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
jobs :
build :
name : Build Dependencies Image
runs-on : ubuntu-latest
steps :
- name : Checkout
uses : actions/checkout@v4
- name : Set up QEMU
uses : docker/setup-qemu-action@v3
with :
platforms : ${{ env.PLATFORMS }}
- name : Set up Docker Buildx
uses : docker/setup-buildx-action@v3
- name : Docker Login
if : ${{ env.IS_PUSHING_IMAGES == 'true' }}
uses : docker/login-action@v3
with :
username : ${{ env.DOCKER_USERNAME }}
password : ${{ env.DOCKER_PASSWORD }}
- name : Docker meta
id : docker_meta
uses : docker/metadata-action@v5
with :
# list of Docker images to use as base name for tags
images : ${{ env.DOCKER_IMAGE }}
# Docker tags based on the following events/attributes
tags : |
2024-09-13 13:41:39 +02:00
type=raw,value=latest
2024-09-12 19:09:03 +02:00
type=sha
- name : Build and push
uses : docker/build-push-action@v6
with :
context : ./dependencies
platforms : ${{ env.PLATFORMS }}
pull : true
push : ${{ env.IS_PUSHING_IMAGES }}
tags : ${{ steps.docker_meta.outputs.tags }}
labels : ${{ steps.docker_meta.outputs.labels }}
2024-09-13 11:44:30 +02:00
cache-from : ${{ env.IS_CACHING == 'true' && 'type=gha' }}
cache-to : ${{ env.IS_CACHING == 'true' && 'type=gha,mode=max' }}
2024-09-13 13:41:39 +02:00
no-cache : ${{ env.IS_CACHING != 'true' }}
2024-09-12 19:09:03 +02:00
sbom : true
provenance : mode=max
annotations : ${{ steps.docker_meta.outputs.annotations }}