Files
aw-bot/.github/workflows/docker-publish.yml
2025-03-24 21:46:35 +01:00

50 lines
1.1 KiB
YAML

name: Build and Push Docker Image
on:
push:
branches:
- main
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
docker:
name: Create Docker Image
runs-on: ubuntu-latest
if: github.ref_type == 'tag'
steps:
- name: Checkout repository
uses: actions/checkout@main
with:
lfs: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.10.0
- name: Log in to DockerHub
uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5.7.0
with:
images: |
alterware/aw-bot
tags: |
${{ github.ref_name }}
latest
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v6.15.0
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max