Skip to content

Add bst-single-updater #71

Add bst-single-updater

Add bst-single-updater #71

Workflow file for this run

name: Docker
on:
push:
branches: main
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
timeout-minutes: 60
if: github.event_name != 'pull_request'
permissions:
packages: write
strategy:
matrix:
platform: [amd64]
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push the base image
id: base_build
uses: docker/build-push-action@v6
if: startsWith(github.event.head_commit.message, '[build-base]:')
with:
context: .
file: Dockerfile.base
platforms: linux/${{ matrix.platform }}
push: ${{ github.event_name != 'pull_request' }}
provenance: false
tags: |
ghcr.io/${{ github.repository }}-base:${{ github.sha }}-${{ matrix.platform }}
ghcr.io/${{ github.repository }}-base:latest-${{ matrix.platform }}
labels: |
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.source=ssh://git@github.com:${{ github.repository }}.git
org.opencontainers.image.url=https://github.com/${{ github.repository }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Create and push the base manifest
if: steps.base_build.outcome == 'success'
run: |
docker manifest create \
ghcr.io/${{ github.repository }}-base:${{ github.sha }} \
--amend ghcr.io/${{ github.repository }}-base:${{ github.sha }}-amd64
docker manifest push ghcr.io/${{ github.repository }}-base:${{ github.sha }}
docker manifest create \
ghcr.io/${{ github.repository }}-base:latest \
--amend ghcr.io/${{ github.repository }}-base:${{ github.sha }}-amd64
docker manifest push ghcr.io/${{ github.repository }}-base:latest
- name: Build and push the image
uses: docker/build-push-action@v6
id: image_build
with:
context: .
file: Dockerfile
platforms: linux/${{ matrix.platform }}
push: ${{ github.event_name != 'pull_request' }}
provenance: false
tags: |
ghcr.io/${{ github.repository }}:${{ github.sha }}-${{ matrix.platform }}
ghcr.io/${{ github.repository }}:latest-${{ matrix.platform }}
labels: |
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.source=ssh://git@github.com:${{ github.repository }}.git
org.opencontainers.image.url=https://github.com/${{ github.repository }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Create and push manifest
if: steps.image_build.outcome == 'success'
run: |
docker manifest create \
ghcr.io/${{ github.repository }}:${{ github.sha }} \
--amend ghcr.io/${{ github.repository }}:${{ github.sha }}-amd64
docker manifest push ghcr.io/${{ github.repository }}:${{ github.sha }}
docker manifest create \
ghcr.io/${{ github.repository }}:latest \
--amend ghcr.io/${{ github.repository }}:${{ github.sha }}-amd64
docker manifest push ghcr.io/${{ github.repository }}:latest