Files
gitea-mirror/.github/workflows/docker-build-stable.yml
2025-05-18 09:31:23 +05:30

46 lines
1.0 KiB
YAML

name: Build and Push Docker Images (Stable)
on:
push:
branches: [main]
tags: ['v*']
pull_request:
env:
REGISTRY: ghcr.io
IMAGE: ${{ github.repository }}
permissions:
contents: write
packages: write
jobs:
docker:
runs-on: ubuntu-latest
services:
redis:
image: redis:7-alpine
ports: ['6379:6379']
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} # Replace with secrets.GHCR_PAT if using PAT
- uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ github.sha }}