twimg-test/.github/workflows/push-to-gitea-registry.yaml
sim1222 5f978e05a9
Some checks failed
Push Docker Image to gitea Container Repository / build-and-push (push) Failing after 17s
fix ref event
2025-01-16 03:34:21 +09:00

42 lines
1.1 KiB
YAML

name: Push Docker Image to gitea Container Repository
on:
push:
branches:
- '**'
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Set up metadata
id: metadata
uses: docker/metadata-action@v5
with:
images: ${{ secrets.REGISTRY }}/${{ github.repository }}
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
type=sha
type=ref,event=push
- name: Build and push
uses: docker/build-push-action@v5
with:
file: ./Dockerfile
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}