| 1 |
name: Docker Image CI
|
| 2 |
|
| 3 |
on:
|
| 4 |
push:
|
| 5 |
branches: [ "main" ]
|
| 6 |
|
| 7 |
concurrency:
|
| 8 |
group: ${{ github.workflow }}-${{ github.ref }}
|
| 9 |
cancel-in-progress: true
|
| 10 |
|
| 11 |
env:
|
| 12 |
DOCKERHUB_PLATFORMS: linux/amd64,linux/arm64
|
| 13 |
BBSD_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/lbbs-bbsd
|
| 14 |
|
| 15 |
jobs:
|
| 16 |
|
| 17 |
build:
|
| 18 |
|
| 19 |
runs-on: ubuntu-latest
|
| 20 |
|
| 21 |
steps:
|
| 22 |
- uses: actions/checkout@v4
|
| 23 |
|
| 24 |
- name: Log in to Docker Hub
|
| 25 |
uses: docker/login-action@v3
|
| 26 |
with:
|
| 27 |
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
| 28 |
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
| 29 |
|
| 30 |
- name: Set up QEMU
|
| 31 |
uses: docker/setup-qemu-action@v3
|
| 32 |
|
| 33 |
- name: Set up Docker Buildx
|
| 34 |
uses: docker/setup-buildx-action@v3
|
| 35 |
|
| 36 |
- name: Extract Docker metadata
|
| 37 |
id: meta
|
| 38 |
uses: docker/metadata-action@v5
|
| 39 |
with:
|
| 40 |
images: ${{ env.BBSD_IMAGE }}
|
| 41 |
|
| 42 |
- name: Build the Docker image
|
| 43 |
id: build-bbsd
|
| 44 |
uses: docker/build-push-action@v5
|
| 45 |
with:
|
| 46 |
platforms: ${{ env.DOCKERHUB_PLATFORMS }}
|
| 47 |
context: .
|
| 48 |
file: Dockerfile/dockerfile.bbsd
|
| 49 |
tags: |
|
| 50 |
${{ steps.meta.outputs.tags }}
|
| 51 |
labels: ${{ steps.meta.outputs.labels }}
|
| 52 |
cache-from: type=gha # Pull cache from GitHub Actions cache
|
| 53 |
cache-to: type=gha,mode=max # Push cache to GitHub Actions cache
|