2021-08-22 07:33:14 +00:00
|
|
|
name: Container Images
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'master'
|
2024-11-15 12:30:10 +00:00
|
|
|
- 'testing'
|
2021-08-22 07:33:14 +00:00
|
|
|
pull_request:
|
|
|
|
workflow_dispatch:
|
|
|
|
schedule:
|
|
|
|
- cron: '45 10 * * 2'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
main:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout Repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Calculate Container Metadata
|
|
|
|
id: meta
|
2024-11-15 12:49:52 +00:00
|
|
|
uses: docker/metadata-action@v4
|
2021-08-22 07:33:14 +00:00
|
|
|
with:
|
|
|
|
images: ghcr.io/${{ github.repository }}
|
2024-11-15 12:49:52 +00:00
|
|
|
tags: |
|
|
|
|
type=raw,value=latest,enable={{is_default_branch}}
|
2024-11-15 13:01:52 +00:00
|
|
|
type=ref,event=branch
|
|
|
|
type=ref,event=tag
|
|
|
|
|
2021-08-22 07:33:14 +00:00
|
|
|
- name: Setup QEMU
|
2025-02-12 21:35:43 +00:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2025-02-12 21:36:40 +00:00
|
|
|
with:
|
2025-02-12 21:35:43 +00:00
|
|
|
image: tonistiigi/binfmt:qemu-v8.1.5
|
2021-08-22 07:33:14 +00:00
|
|
|
|
|
|
|
- name: Setup Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
|
|
|
|
- name: Cache Layers
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: /tmp/buildx-cache
|
|
|
|
key: buildx-cache-${{ github.sha }}
|
|
|
|
restore-keys: |
|
|
|
|
buildx-cache-
|
|
|
|
|
|
|
|
- name: Login to GitHub Container Registry
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Build and Push Images
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
2022-12-16 23:14:07 +00:00
|
|
|
platforms: linux/amd64, linux/386, linux/arm64, linux/arm/v7
|
2021-08-22 07:33:14 +00:00
|
|
|
cache-from: type=local,src=/tmp/buildx-cache
|
|
|
|
cache-to: type=local,dest=/tmp/buildx-cache-new,mode=max
|
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
|
|
|
|
- name: Move Cache
|
|
|
|
run: |
|
|
|
|
rm -rf /tmp/buildx-cache
|
|
|
|
mv /tmp/buildx-cache-new /tmp/buildx-cache
|