Skip to content

snapshot

snapshot #3

Workflow file for this run

name: snapshot
# Build and publish snapshot (pre-release) Docker images.
# - Triggers: Scheduled daily and manual dispatch.
# - Runs on: Only the official repository (FirebirdSQL/firebird-docker)
#
# Snapshot images use tags like '6-snapshot', '5-snapshot', '4-snapshot'
# from the FirebirdSQL/snapshots GitHub repository.
on:
schedule:
- cron: "0 6 * * *" # Daily at 06:00 UTC
workflow_dispatch:
inputs:
branch:
description: 'Snapshot branch to build'
required: true
type: choice
options:
- master
- v5.0-release
- v4.0
default: master
# Only a single instance of this workflow can be in execution at a given time.
concurrency:
group: ${{ github.workflow }}
jobs:
build-snapshot:
if: ${{ github.repository == 'FirebirdSQL/firebird-docker' }}
strategy:
fail-fast: false
matrix:
branch: ${{ github.event_name == 'workflow_dispatch' && fromJSON(format('["{0}"]', inputs.branch)) || fromJSON('["master", "v5.0-release"]') }}
arch: [amd64, arm64]
include:
- arch: amd64
runner: ubuntu-latest
- arch: arm64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Install tools
shell: pwsh
run: |
Install-Module InvokeBuild -Force
Install-Module PSFirebird -MinimumVersion '1.0.0' -Force
- name: Build snapshot
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Invoke-Build Build-Snapshot -Branch '${{ matrix.branch }}'
- name: Login to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push snapshot
shell: pwsh
run: |
$branch = '${{ matrix.branch }}'
$tag = switch ($branch) {
'master' { '6-snapshot' }
'v5.0-release' { '5-snapshot' }
'v4.0' { '4-snapshot' }
}
$assets = Get-Content -Raw ./assets.json | ConvertFrom-Json
$defaultDistro = $assets.config.defaultDistro
docker push "firebirdsql/firebird:$tag"
docker push "firebirdsql/firebird:$tag-$defaultDistro"